[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
bin/48201: +noclobber option not POSIX compliant
>Synopsis: +noclobber option not POSIX compliant
>Arrival-Date: Tue Sep 10 05:00:00 +0000 2013
>Originator: William Ahern
NetBSD 6.1.1 NetBSD 6.1.1 (GENERIC) amd64
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.
sh -c 'set -C; printf "" >/dev/null'
Main Index |
Thread Index |