in reply to Exit status of Net::Telnet question
Because in Bash $? holds the exit value of the last command, and test -f checks to see if the file given exists and is a regular file, $result[0] should contain either a 1 (file does not exist) or a 0 (file does exist). After you determine that, you can cat your file or display the appropriate error.my @result = $object->cmd('test -f foo.txt; echo $?')
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Exit status of Net::Telnet question
by JoeJaz (Monk) on Jun 23, 2003 at 14:17 UTC |