rashley has asked for the wisdom of the Perl Monks concerning the following question:
It's my understanding that a system() call will return zero if it was successful.
I'm doing:
The problem is that it's returning zero on SCPs that couldn't possibly have succeded (because I'm giving it junk for $target_host).unless ( system( "scp $file $target_host" ) == 0 ) { #error handling code here }
So how can I check to see if the SCP was really successful?
Btw, yes, I know that there are better ways to do this than a system() call, but for long-winded reasons, this is what I'm stuck with. Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Error checking on system SCP
by ikegami (Patriarch) on Dec 14, 2005 at 18:36 UTC | |
by rashley (Scribe) on Dec 14, 2005 at 19:22 UTC | |
by ikegami (Patriarch) on Dec 14, 2005 at 19:45 UTC | |
|
Re: Error checking on system SCP
by ptum (Priest) on Dec 14, 2005 at 18:27 UTC | |
|
Re: Error checking on system SCP
by turo (Friar) on Dec 14, 2005 at 20:14 UTC | |
by rashley (Scribe) on Dec 14, 2005 at 20:20 UTC | |
by turo (Friar) on Dec 14, 2005 at 20:38 UTC |