Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

I am unable to execute series of command through IPC::Cmd

by veeruch (Sexton)
on Dec 14, 2006 at 15:08 UTC ( [id://589838]=perlquestion: print w/replies, xml ) Need Help??

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

Hi perlmonks,

Is there any module to hold the command line session inside localhost. I am using IPC::Cmd, but unable to hold the previous session. Example:
my( $success, $error_code, $full_buf) = run( command => "cd /home/john +/test", verbose => 0 ); ($success, $error_code, $full_buf) = run( command => "pwd", verbose => + 0 );
While executing the above code, the second line returns '/home/john' instead of '/home/john/test'.
Because, test folder is present in '/home/john'.

Chain of commands in a single run is working but I need to run one after the other based on the output of the first run.
Is there anyother way or Module to handle the above situation
Please help me on this

Replies are listed 'Best First'.
Re: I am unable to execute series of command through IPC::Cmd
by Joost (Canon) on Dec 14, 2006 at 15:18 UTC
      Thank YOU somuch Joost,

      your code helped me a lot and it solved many of our problems.
      Once again Thanks a lot.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2024-04-19 18:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found