[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
bin/46455: /bin/sh: set -C breaks 2>/dev/null redirection
>Synopsis: /bin/sh: set -C breaks 2>/dev/null redirection
>Arrival-Date: Tue May 15 09:05:00 +0000 2012
>Originator: Paul Onyschuk
NetBSD Labla 6.0_BETA NetBSD 6.0_BETA (GENERIC) i386
/bin/sh doesn't handle noclobber option and 2>/dev/null redirection
at the same time. Script fails just silently and aborts further
execution. This can be overridden by using 2>|/dev/null instead
(n<>| overrides -C).
Still what concerns me is the difference in behavior of /bin/sh
and /bin/ksh. With ksh it works just fine. Is this intended behavior
of /bin/sh or a bug?
# Empty file with "testfile" name should be created,
# if it doesn't exist yet.
2>/dev/null > testfile && echo "yes, it works!"
Main Index |
Thread Index |