in reply to Re: -s test option returns differently in some cases
in thread -s test option returns differently in some cases
And its output:print "# File is located at: $myAbsPathToFile\n" if (-e $myAbsPathToFi +le); if (-s $myAbsPathToFile) { print "Good to go\n"; } else { print "# File $myAbsPathToFile is empty or missing: $!. Cannot con +tinue!\n"; exit; }
# File is located at: /nfs/home/frogsausage/file # File /nfs/home/frogsausage/file is empty or missing: No such file or + directory. Cannot continue!
Note how awkward it is: first test is saying "Can find it, it exists!", and the second says "Nope, no such file or directory". These lines are like that in the final code: no statements in between and it isn't part of a loop or anything like that.
Edit: @hdb Indeed! I corrected typo after edit. I converted full path to variable again hence why. Thanks for the head up. Output is still the same after the typo edit.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: -s test option returns differently in some cases
by hdb (Monsignor) on Oct 14, 2013 at 08:48 UTC | |
by frogsausage (Sexton) on Oct 14, 2013 at 09:13 UTC | |
by frogsausage (Sexton) on Oct 14, 2013 at 08:53 UTC |