Hi all,
I'm trying to rsh in to a bunch of machines and use perl to do a search and replace of some text. It doesn't give any error message(s), but it also doesn't change the file on either the local box or the machine I'm rshing to.
This runs and *seems* successful by using normal rsh, but actually changes nothing. Note that it failed using the first two authentication methods, but is OK the last time. This is consistent with other commands with rsh that work.
#/usr/kerberos/bin/rsh remote-host /usr/bin/perl -p -i -e
's/^#\s+NETDUMPADDR=/#\+NETDUMPADDR=\nNETDUMPADDR=ip-address-here\n/g'
+ /etc/sysconfig/netdump
connect to address ip-address-here: Connection refused
Trying krb4 rsh...
connect to address ip-address-here: Connection refused
trying normal rsh (/usr/bin/rsh)
#
even though this works, i.e. actually replaces text, on the local system:
#/usr/bin/perl -p -i -e 's/^# NETDUMPADDR=/# NETDUMPADDR=\nNETDUMPADDR
+=ip-address-here\n/g' netdump
I suppose I could rcp from the remote host to the local host, change it, then copy it back, but that seems kinda kludgey. Anybody know what I'm missing here?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
|
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.