Did I miss something really obvious?Well...
The following code shows a successful 'cd' for me
If you have a runnable example of where it doesn't work for you, I'd be glad to try it. You might also try IPCRUNDEBUG. Do an 'export IPCRUNDEBUG=details' before running your script. I believe what the author meant was that you couldn't do things like 'cd' (well, chdir) in your parent script between pump calls.#! /usr/bin/perl use strict; use IPC::Run qw( start pump finish ); my ($input, $output, $errput); $input=""; $output=""; my $subp = start([ '/bin/bash' ], \$input, \$output, \$errput) or die $@; print $errput; $input .= "cd /work/drjohnson\n"; pump $subp until length $input == 0; $input .= "pwd\n"; pump $subp until $output =~ /\n/; print "$output\n"; $subp->finish;
fnord
In reply to Re: Automating a shell session: cd does not work
by Illuminatus
in thread Automating a shell session: cd does not work
by pokki
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |