1. A shell-command returns '0' on success, and $? > 0 on failure.
This one-liner illustrates this (on unix):
perl -e 'print "true" if `/bin/true`, $?; print "false" if `/bin/false +`, $?' false
2. Your code will state a succesful call if the command produced any output on STDOUT, check $? for the return-code instead of the output!
regards,
tomte
In reply to Re: Successful returns Unsuccessful
by Tomte
in thread Successful returns Unsuccessful
by 2mths
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |