Hey guys,
I'm trying to use sed in an ssh loop to add a line after another line. The script (with other irrelevant parts omitted) is this:
ssh root@x.x.x.x'sed /RewriteRule ^ /auction-(.*) /auction.php?id=$1 [QSA,L]/ a\
RewriteRule ^ /browse-(.*) /browse.php?id=$1 [QSA,L]'/etc/httpd/conf/extra/httpd-macro-vhosts.conf'
Ignore the space between the ^ and the / since reddit takes it as formatting expressions.
I can't figure out how to get the strings to NOT be interpreted as expressions instead of strings to be replaced, and also I can't seem to get the whole command to run as one command in ssh, since the ' seems to conflict.
[link][4 comments]