[Ssh-sftp-perl-users] Recieving EOF from client via Net::SSH::Perl
Brought to you by:
dbrobins
From: Chaun K. <scu...@ho...> - 2004-10-27 19:03:36
|
Hello, I'm new to the list and am having a small problem with Net::SSH::Perl. I have a chunk of code that needs to be run on a remote machine via SSH2 and general commands that I am using seem to run fine. The problem I am having originates from an interactive form that pops up when I execute the p4 submit command. When I am logged into the server I can issue the command just like it is described in my code snippet, however, I need to complete it by pressing CTRL-D. I though that I could do the same thing in my Perl script with the /cD syntax, but from the output of the Net::SSH::Perl session below, it just hangs, seemingly waiting for "channel 4: rcvd eof" Thanks for any help you could offer, I don't see much on Google for this Module. ~Chaun Here is my code snippet: [snip] ($sshout, $ssherr, $sshexit) = $ssh->cmd("p4 add /path/to/file/Sample.jpg"); $sshout_p4add = $sshout; $ssherr_p4add = $ssherr; $sshexit_p4add = $sshexit; ($sshout, $ssherr, $sshexit) = $ssh->cmd("p4 submit -i\nChange: new\nClient: all_username\nUser: username\nStatus: new\nDescription: tTrack Issue: 3390\nFiles: //path/to/file/Sample.jpg # add\n\cD"); $sshout_p4sub = $sshout; $ssherr_p4sub = $ssherr; $sshexit_p4sub = $sshexit; [end snip] Here is the output from the Net:SSH::Perl session <server_name.com>: channel 3: new [client-session] <server_name.com>: Requesting channel_open for channel 3. <server_name.com>: Entering interactive session. <server_name.com>: Sending command: p4 add /path/to/file/Sample.jpg <server_name.com>: Requesting service exec on channel 3. <server_name.com>: channel 3: open confirm rwindow 0 rmax 32768 <server_name.com>: channel 3: rcvd eof <server_name.com>: channel 3: output open -> drain <server_name.com>: input_channel_request: rtype exit-status reply 0 <server_name.com>: channel 3: rcvd close <server_name.com>: channel 3: input open -> closed <server_name.com>: channel 3: close_read <server_name.com>: channel 3: obuf empty <server_name.com>: channel 3: output drain -> closed <server_name.com>: channel 3: close_write <server_name.com>: channel 3: send close <server_name.com>: channel 3: full closed <server_name.com>: channel 4: new [client-session] <server_name.com>: Requesting channel_open for channel 4. <server_name.com>: Entering interactive session. <server_name.com>: Sending command: p4 submit -i Change: new Client: all_username User: username Status: new Description: tTrack Issue: 3390 Files: //path/to/file/Sample.jpg # add <server_name.com>: Requesting service exec on channel 4. <server_name.com>: channel 4: open confirm rwindow 0 rmax 32768 _________________________________________________________________ Check out Election 2004 for up-to-date election news, plus voter tools and more! http://special.msn.com/msn/election2004.armx |