NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/48201: +noclobber option not POSIX compliant



>Number:         48201
>Category:       bin
>Synopsis:       +noclobber option not POSIX compliant
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 10 05:00:00 +0000 2013
>Originator:     William Ahern
>Release:        6.1.1
>Organization:
N/A
>Environment:
NetBSD  6.1.1 NetBSD 6.1.1 (GENERIC) amd64
>Description:
POSIX says: "Output redirection using the '>' format shall fail if the 
noclobber option is set (see the description of set -C) and the file named by 
the expansion of word exists and is a regular file."

However, with +noclobber NetBSD's sh fails when redirecting to /dev/null, a 
character device. I had to fix my scripts to use the append (>>) operator. 
FreeBSD, OpenBSD, Linux, Solaris, and OS X all behave as POSIX describes.



>How-To-Repeat:
sh -c 'set -C; printf "" >/dev/null'
>Fix:



Home | Main Index | Thread Index | Old Index