I'm writing a script which is meant to ssh into a remote machine, sed a file there, and write the output to a new file on the remote machine. Obviously the easy way to do this is to write and execute the script on the remote machine, but I'm trying to do this all via ssh since I like to keep and execute my scripts from a central location.
So here's my extremely ugly attempt so far:
#Do the following on a remote server: #ssh in, then operates on some files in the remotedir directory #sed from an "mg" file (such as host1.mg), replacing all instances of #host1 and replacing it with a new string from a after.conf #and then writing the output to the remotedir directory. #Assume that the after.conf only has one value right now (host2)
the script bombs out - it seems like the redirect is trying to force the output onto my local machine I think. I'm sure I'm doing several things wrong here. Can anyone help?