in reply to Re: SFTP return value from shell to perl
in thread SFTP return value from shell to perl

Hi,
Thanks for the reply, yes it is non interative ie., it don't ask pwd to enter. now i want the return value of that runned sftp command
Thanks
Shanmugam A.

  • Comment on Re^2: SFTP return value from shell to perl

Replies are listed 'Best First'.
Re^3: SFTP return value from shell to perl
by aaron_baugher (Curate) on Apr 05, 2012 at 20:35 UTC

    In that case, you can use system by putting your commands into a batchfile for sftp. Untested:

    my $batchfile = "/tmp/batchfile.$$"; open my $bfd, '>', $batchfile or die $!; print $bfd <<EOF; put $gz_filename $dest_path bye EOF close $bfd; my $return_value = system('sftp', "-b $batchfile", $host); unlink $batchfile;

    Aaron B.
    My Woefully Neglected Blog, where I occasionally mention Perl.

      Hi Aaron,

      Thanks for you reply, and Thanks a lot it works fine.

      By
      Shanmugam A.