Lionel Felicite wrote...

> even on fresh install, file returns O even if a file/directory
> (directory in my case) doesn't exist

This behaviour, although a bit surprising, is actually a feature. Use
file's -E option to get a non-zero exit code in such a situation.

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/file.html#tag_20_46_10

states:

| If the file named by the file operand does not exist, cannot be read,
| or the type of the file named by the file operand cannot be
| determined, this shall not be considered an error that affects the
| exit status.

The upstream bug report about this can be found at
http://bugs.gw.com/view.php?id=316

Regards,

    Christoph

Attachment: signature.asc
Description: Digital signature

Reply via email to