in reply to Search and replace on remote system using rsh
Note that you can include the "-i" and "-p" flags on the shebang line of the script file, so the script itself can still be just a one-liner (after the shebang line).- scp filter.pl remote.host:/your/home/filter.pl - ssh remote.host /your/home/filter.pl /etc/sysconfig/netdump
If the idea is that each remote host needs a different value in "ip-address-here", you just need a script on the local host that loops over the list of remote hosts, and for each one:
This will avoid the problem your having with insufficient quoting/escaping of shell metacharacters needed for the command-line perl script to work as intended in the remote shell.- create the version of the script for this host as "tmp.pl" - scp tmp.pl remote.host:/your/path/tmp.pl - ssh remote.host /your/path/tmp.pl /etc/sysconfig/netdump - for neatness, tmp.pl could include a third line (after the shebang and the s/.../.../): END { unlink /your/path/tmp.pl }
|
|---|