bash - Sed command not working through SSH -
consider following command:
ssh machine sed -i 's#\[ "\$jboss_mode" = "standalone" \]#\[ "\$jboss_mode" = "sim_standalone" \]#' /tmp/sim-wildfly
when run command command line, error:
sed: -e expression #1, char 3: unterminated `s' command
however, when ssh particular machine first, , run sed
part of command, works fine:
> ssh machine > sed -i 's#\[ "\$jboss_mode" = "standalone" \]#\[ "\$jboss_mode" = "sim_standalone" \]#' /tmp/sim-wildfly
any idea why happen?
edit: believe has how i'm escaping characters, because tried simple test replacement no escaped characters , worked fine. tried double-escaping, didn't work either.
try ssh
here-doc avoid crazy escaping:
ssh -t -t machine <<'eof' sed -i 's#\[ "\$jboss_mode" = "standalone" \]#\[ "\$jboss_mode" = "sim_standalone" \]#' /tmp/sim-wildfly exit eof
Comments
Post a Comment