in reply to Re^11: Asynchronous Processing a command execution
in thread Asynchronous Processing a command execution

This node falls below the community's threshold of quality. You may see it by logging in.
  • Comment on Re^12: Asynchronous Processing a command execution

Replies are listed 'Best First'.
Re^13: Asynchronous Processing a command execution
by Corion (Patriarch) on Jul 04, 2008 at 14:35 UTC

    I'm sure I'm not the first one pointing out How (not) to ask a question to you. You keep the error message to yourself, you keep the code to yourself, you show no effort of attacking the problem on your own. Reduce your program until the error goes away, then slowly add thing in until it shows up again. Then you have isolated one error cause.

      Corion, I have now finely settled down with my code and able to execute it fine.So her eI'm executing the same traceroute command which is forked out . I would like to have a command executed on the remote server via SSH and get the output streaming and display. Let me know if can give me a hint on how to go about this,since the SSH module I tried wasn't giving me a option to asynchronously process a command's output.
        Hi It had been really confusing , however I have managed to do asynchronous SSH output using SSH Perl module. Here is teh code extract
        elsif (defined $pid) { close STDOUT; close STDERR; $ssh=Net::SSH::Perl->new("113.128.160.214"); $ssh->login($UNM,$Pass,'true'); $cmd="ls -l"; $ssh->register_handler(SSH_SMSG_STDOUT_DATA,sub{($ssh,$packetout)=@_;$ +cache->set($session,[0,$packetout->get_str])}); #$ssh->register_handler(SSH_SMSG_EXITSTATUS,sub{($ssh,$packetexit)=@_; +$cache->set($session,[1,$packetexit->get_str])}); ($stdout,$stderr,$exit)=$ssh->cmd($cmd);
        The above code returns me the standard output from the command executed over SSH.I would also like to print messages like connecting to the remotebox ,any errors occured while connection.I tried Standard Error message constant . but it did not return me anything worthwhile. Please advise