Rob Landley <r...@landley.net> writes:

> Do you also need a specific tool to check if a file is zero length?
> Because "touch file; [ -f file -a 0 -eq "$(stat -c%s file)" ] && echo
> boom" is a similar level of complexity, since merely going stat -c%s
> file doesn't prove that file exits and isn't a directory...

test -f file && ! test -s file is probably slightly faster since test
is typically a builtin (not that it really matters).

Collin

Reply via email to