in reply to Re: feeding stdin of executed command and store stdout in $var
in thread feeding stdin of executed command and store stdout in $var

how i send several commands with IPC::run ?
  • Comment on Re^2: feeding stdin of executed command and store stdout in $var

Replies are listed 'Best First'.
Re^3: feeding stdin of executed command and store stdout in $var
by haukex (Archbishop) on Jan 25, 2017 at 14:43 UTC

    Hi gabrielsousa,

    how i send several commands with IPC::run ?

    IPC::Run's interface takes a little bit of getting used to, but have a look at the doc and example code of the pump() function.

    Regards,
    -- Hauke D

      my @cmd=('lftp', '-u', "$user,$pass", '-e', "open", "$host"); my $h = start \@cmd, \$in, \$out, \$err, timeout( 10 ); $in .= "ls\n"; $in .= "ls\n"; pump $h; print $out; finish $h;
      do not work :( only print after the finish $h;