freebsd-skq/bin/sh/tests/execution/set-C1.0
jilles 2cc3e8939f sh: Add simple test for 'set -C' (noclobber).
To ensure fast test runs, race conditions are not tested.
2016-11-02 22:33:37 +00:00

13 lines
226 B
Plaintext

# $FreeBSD$
T=$(mktemp -d "${TMPDIR:-/tmp}/sh-test.XXXXXXXX") || exit
trap 'rm -rf "$T"' 0
set -C
echo . >"$T/a" &&
[ -s "$T/a" ] &&
{ ! true >"$T/a"; } 2>/dev/null &&
[ -s "$T/a" ] &&
ln -s /dev/null "$T/b" &&
true >"$T/b"