[Bug 234498] Request for additional switches in /bin/test

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sat Dec 29 22:59:19 UTC 2018


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

            Bug ID: 234498
           Summary: Request for additional switches in /bin/test
           Product: Base System
           Version: 12.0-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs at FreeBSD.org
          Reporter: bourne.identity at hotmail.com

It is often needed by users to test for files and directories in the
filesystem:

[ -f <abc> ]
[ -d <xyz> ]

While the tests above work as intended, the tests fail if the entities <abc> /
<xyz> are symbolic links. The user often wants to find out:

Is <abc> a regular file ? Or alternatively, is <abc> a symlink pointing to a
regular file ? (Both cases acceptable)

Is <xyz> a directory ? Or alternatively, is <xyz> a symlink pointing to a
directory ? (Both cases acceptable)

The tests above need additional switches, perhaps -F and -D :

-F returns true for regular file as well as valid symlink pointing to regular
file.
-D returns true for directory as well as valid symlink pointing to directory.


Thanks for any action taken on this request.
Manish Jain

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


More information about the freebsd-bugs mailing list