
다음과 같이 America/Adak 문자열을 America/Jamaica로 바꾸고 싶습니다.
perl -i -pe "s/$A/$B/" /etc/sysconfig/clock
Perl 구문에서 업데이트해야 할 사항에 대해 조언을 부탁드립니다. (문제는 "/"가 있으므로 이 고유 문자를 무시해야 한다는 것입니다. 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