[Bug 232730] usr.bin/file does not return correct exit code on missing input file

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Fri Oct 26 19:50:22 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=232730

            Bug ID: 232730
           Summary: usr.bin/file does not return correct exit code on
                    missing input file
           Product: Base System
           Version: 11.2-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs at FreeBSD.org
          Reporter: nmingotti at gmail.com

Hi,

According to "man file", "RETURN CODE" section:
--------
file returns 0 on success, and non-zero on error.
--------

But this is what happens:
--------------
$> file non-existent-file
non-existent: cannot open `non-existent' (No such file or directory)
$> echo $?
0
--------------

The exit code should not be zero.

bye
Nicola

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list