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

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

  • Comment on Re^3: feeding stdin of executed command and store stdout in $var

Replies are listed 'Best First'.
Re^4: feeding stdin of executed command and store stdout in $var
by gabrielsousa (Sexton) on Jan 25, 2017 at 16:44 UTC
    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;