I would like to change a string in a remote file after twice ssh login to modify
cake no
to
cake yes
(1)
sedscript='s/cake.*no/cake yes/g'
ssh host1 "ssh host2 sed -i $sedscript ~/test.config"
There is always the error.
sed: -e expression #1, char 51: unterminated `s' command
(2) If change the regex as below,
sedscript='s/cake.*no/cake[[:space:]]yes/g'
The result will be
case[[:space:]]yes
Is there anyone who knows how to get the result "case yes"?
Comments
Post a Comment