我安装了这个ttf-mscorefonts-installer
包来为我的系统获得额外的字体。
然后我注意到文件是“exe”。为什么?
据我所知,字体不是二进制文件。
$ sudo apt-get install "ttf-mscorefonts-installer"
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
ttf-mscorefonts-installer
0 upgraded, 1 newly installed, 0 to remove and 9 not upgraded.
Need to get 0 B/27.8 kB of archives.
After this operation, 134 kB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously unselected package ttf-mscorefonts-installer.
(Reading database ... 298130 files and directories currently installed.)
Preparing to …
Run Code Online (Sandbox Code Playgroud) 我正在尝试创建一个全局计数器变量来查看~/.profile
执行了多少次。因此:
在~/.bashrc
:
# ...
if [ "$PROFILE_EXEC_TIMES" = "" ]; then
export PROFILE_EXEC_TIMES=0
fi
let "PROFILE_EXEC_TIMES += 1"
Run Code Online (Sandbox Code Playgroud)
在~/.profile
:
# ...
export PROFILE_EXEC_TIMES
let "PROFILE_EXEC_TIMES += 1"
Run Code Online (Sandbox Code Playgroud)
但是当我打开一个新的 shell 并写入时echo $PROFILE_EXEC_TIMES
,我得到的只是1
. $PROFILE_EXEC_TIMES
必须至少为 2。我怀疑这~/.profile
不是由 bash 提供的……如果是这样,我需要做什么来检查~/.profile
执行了多少次?
编辑:
我注意到通过以下行/etc/gdm/Xsession
采购~/.profile
:
test -f "$HOME/.profile" && . "$HOME/.profile"
Run Code Online (Sandbox Code Playgroud)
并~/.bashrc
来源于~/.profile
以下几行:
# if running bash
if [ -n "$BASH_VERSION" ]; then
# …
Run Code Online (Sandbox Code Playgroud) 如您所见,mysql 仅存在于/etc/init.d
目录中而不存在于中/etc/rcN.d
,因此它不应在启动时启动。
$ sudo find /etc -regex ".*\(rc.*d\|init\.d\).*" | sudo grep "mysql" | sort
/etc/init.d/mysql
Run Code Online (Sandbox Code Playgroud) 我希望创建一个仅在运行级别 3 启动时运行一次的脚本。
因此,现在我执行测试以查看执行是否真的有效。
我试图创建一个/etc/init.d/myscript
包含以下内容的文件:
#!/bin/bash
OUT="/dev/tty1"
echo -e "Hello world!" > $OUT
ps auxf > /path_to_some_folder/_script_ps_auxf.txt
runlevel > /path_to_some_folder/_runlevel.txt
id -u > /path_to_some_folder/id.txt
pwd > /path_to_some_folder/pwd.txt
Run Code Online (Sandbox Code Playgroud)
该文件为所有用户启用了执行位(ugo)。
我还创建了一个指向/etc/init.d/myscript
at的符号链接/etc/rc3.d/S99myscript
。然后我:
CTRL
+ ALT
+F2
中才能看到tty2
。sudo service lightdm stop
禁用 GUI。sudo init 3
为了处于运行级别 3。但在文件/path_to_some_folder/
后不存在的init 3
。为什么?
我还尝试了上述几种其他变体 - 包括update-rc.d
.
此外,我尝试进行编辑/etc/rc.local
,以便将代码/etc/init.d/myscript
嵌入/etc/rc.local
到该exit 0
行之前,但仍然没有任何反应(没有创建文件)。