我有一台 Linux 机器,我有一个名为load_info的脚本,该脚本位于 /var
我希望能够load_info从另一个目录运行脚本,而不必在命令前加上“./”
例如,如果我在 /root 中,我希望能够输入load_info(不带 ./)并让它执行/var/load_info脚本。
那么我如何制作它以便如果我cd /root可以输入load_info 并让它运行 /var/load_info 脚本。
我想用 America/Jamaica 替换字符串 America/Adak:
perl -i -pe "s/$A/$B/" /etc/sysconfig/clock
Run Code Online (Sandbox Code Playgroud)
请建议需要在 perl 语法中更新什么?(问题是我有“/”所以需要忽略这个 uniq 字符,需要在我的 perl 语法中添加什么?
A="America/Adak"
B="America/Jamaica"
CLOCK=/etc/sysconfig/clock
perl -i -pe "s/$A/$B/" $CLOCK
Bareword found where operator expected at -e line 1, near "s/America/Adak/America"
syntax error at -e line 1, near "s/America/Adak/America"
Execution of -e aborted due to compilation errors.
more $CLOCK
# The ZONE parameter is only evaluated by system-config-date.
# The timezone of the system is defined by the contents of /etc/localtime.
ZONE="America/Adak"
UTC=true
ARC=false
Run Code Online (Sandbox Code Playgroud) 我有 Solaris 机器,默认情况下 tcsh 是 shell
例如,如何将默认 shell 更改为 bash - 注销并再次登录后,我会将 bash 放置到 tcsh!
我的意思是在注销并通过 ps 命令登录后,我会看到 bash 而不是 tcsh ,
my_solaris:/ ROOT > ps
PID TTY TIME CMD
13950 pts/4 0:00 ps
9951 pts/4 0:00 tcsh
Run Code Online (Sandbox Code Playgroud) 在我的 Red Hat 5.3 Linux 机器上,没有安装 NTP(由于某些原因无法安装)。
但是我可以将二进制文件 /usr/sbin/ntpdate 从另一台 Linux 机器复制到我的。
如果我只获取文件 ntpdate 并将其放在我的 Linux 机器上的 /tmp 下,是否可以运行
/tmp/ntpdate -u 109.23.4.5
Run Code Online (Sandbox Code Playgroud)
为了更新我的日期?
109.23.4.5 将是我的 Linux 机器。
是否有与 linux screen 命令等效的solaris?
示例如何在 Linux 中使用 screen 命令
example for linux : screen -D -m ./run_some_script.pl
example for Solaris : ?
Run Code Online (Sandbox Code Playgroud)
Linux 屏幕命令的手册页:http : //www.oreillynet.com/linux/cmd/cmd.csp? path= s/ screen