我想用 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)
归档时间: |
|
查看次数: |
129 次 |
最近记录: |