in reply to Re: How to capture log from external interactive process
in thread How to capture log from external interactive process

rc=$? if [[ ${rc} -ne 0 ]]; then echo "cp -i $file1 $file2 failed with a value of ${rc}" fi

Thank you for reminding me of why I shall never, ever learn shell scripting and shall forever stick with Perl. :)

Replies are listed 'Best First'.
Re^3: How to capture log from external interactive process
by LessMonk (Initiate) on Sep 17, 2004 at 14:44 UTC
    Thanks for your help guys, but I'm still stumped.

    Script may well work but I need to do all this from a perl script.

    1) execute external program from perl
    2) using perl or shell scripting magic, log the programs output and user input
    3) use perl to check the exit status of the program

    I've tried using perl's open3, but then stdout/stderr/stdin all get piped to perl :(