Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Getting error when runing perl through ssh

by perlknight (Pilgrim)
on Nov 26, 2005 at 15:30 UTC ( [id://511903]=perlquestion: print w/replies, xml ) Need Help??

perlknight has asked for the wisdom of the Perl Monks concerning the following question:

all, this ran fined locally:
perl -ibkup -ne '{ s/192.168.10.55/db1.abc.com/g; print "$_\n";}' tnsn +ames.ora
But it bails out on ssh, like so:
ssh -lroot somehost "perl -ibkup -ne '{ s/192.168.10.55/db1.abc.com/g; + print \"$_\n\";}' tnsnames.ora"
Any idea why? Thanks.

Replies are listed 'Best First'.
Re: Getting error when runing perl through ssh
by PodMaster (Abbot) on Nov 26, 2005 at 15:57 UTC
    Probably because you, your shell and the remote shell disagree on what its trying to execute (which arguments to give to perl).

    Try echo to see what's going on.

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

Re: Getting error when runing perl through ssh
by tirwhan (Abbot) on Nov 26, 2005 at 16:09 UTC
    Use the absolute path for the perl executable, it is possible that your path is not set as you expect it. So do
    ssh -lroot somehost "/usr/bin/perl -ibkup -ne '{ s/192.168.10.55/db1.a +bc.com/g; print \"$_\n\";}' tnsnames.ora"

    Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -- Brian W. Kernighan

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://511903]
Approved by planetscape
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-25 17:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found