Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

remsh using perl script

by RajNaidu (Novice)
on Jan 04, 2012 at 09:45 UTC ( #946213=perlquestion: print w/ replies, xml ) Need Help??
RajNaidu has asked for the wisdom of the Perl Monks concerning the following question:

I need a perl script which remsh to another machine with different login and execute some command. I tried executing a simple perl code, but it does not execute the required command in the remote machine. Here in the remote machine /tmp/1 is empty, it does not output the ls command in /tmp/1

#!/app/perl `/usr/bin/remsh guitar.cc.ux.com << EOF perlguru go4fun ls > /tmp/1 EOF`

Comment on remsh using perl script
Download Code
Re: remsh using perl script
by Corion (Pope) on Jan 04, 2012 at 10:14 UTC

    Have you tried your remsh script as a stand-alone shell script? Does it work as a stand-alone shell script?

    Launching complicated text as commands from Perl does not magically make things work.

      Even as shell script, I am getting same output as perl. i.e on remote machine commands are not getting executing. Any suggestions to improve the code ?

        RajNaidu:

        If it's doing the same as a shell script, then it's not a perl problem. Solve the problem, and *then* bundle it into a perl script. There are many unix support forums that can help you with that bit.

        Having said that, I'd suggest doing something simple in your remsh script to help you find the problem, such as:

        set >RajNaidu.test.remsh

        Then log into the remote machine and locate the RajNaidu.test.remsh file and check that the directory and environment is what you expect. Then add bits of your script to it and echo your errors to a file to get clues as to what's failing and why.

        ...roboticus

        When your only tool is a hammer, all problems look like your thumb.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2014-07-12 15:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (240 votes), past polls