in reply to Running script from script

You can check $? after running system(...). Basically, it should be zero if all was successful and >0 otherwise (also -1 if the command failed to run, check $!).

Wrapping everything in packages is a matter of choice. I don't think it's nessecary to do it in such a small script, other people may disagree with me.

Sorry if my advice was wrong.

Replies are listed 'Best First'.
Re^2: Running script from script
by Ransom (Beadle) on Jul 11, 2012 at 15:10 UTC

    Ok cool thanks. Found this after looking at your post

    $? = The status returned by the last pipe close, backtick(``) command or system operator. Note that this is the status word returned by the wait() system call, so the exit value of the subprocess is actually ($? >>*). $? & 255 gives which signal, if any, the process died from, and whether there was a core dump.

    Tested it and it seems to work as expected and allows me to handle the errors.

    Ransom