I'm trying to use
/usr/bin/file to detect file types in a program but also would like it to report if the file does not exist. However the command always returns exit status 0.
Besides grepping the output, is there a way to make
/usr/bin/file exit non-zero on file not found? Or is there another command that has this behavior?