in reply to Re: -s testing for empty file; works on local, but not on remotein thread -s testing for empty file; works on local, but not on remote
There is one difference:
If you don't check for errors, errors (incl non-existent files) being returned by -s will be mistaken as empty file.
If you don't check for errors, errors (incl non-existent files) being returned by -z will be mistaken as non-empty file.
stat can fail for a number of reasons.
Add the following before the if (-s) line:
What's the output?
DejaVu Sans Mono
Droid Sans Mono
Envy Code R
Source Code Pro
The default, whatever it is
Results (379 votes). Check out past polls.