1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

tests/subshell.sh: fix a test for systems without /dev/fd/*

ksh's built-in test, [ and [[ commands treat /dev/fd/* specially:
e.g. 'test /dev/fd/0' returns true even if it doesn't physically
exist, as on e.g. HP-UX. However, external commands need it to
exist physically.

src/cmd/ksh93/tests/subshell.sh:
- To decide whether to run a test with 'tee', use external 'test'
  command to check if /dev/stdout and /dev/fd/1 actually exist.
This commit is contained in:
Martijn Dekker 2020-07-21 00:04:33 +01:00
parent bc8b36faba
commit 0c96f9749b

View file

@ -625,7 +625,7 @@ $SHELL <<- \EOF
EOF
for f in /dev/stdout /dev/fd/1
do if [[ -e $f ]]
do if "${ whence -p test; }" -e "$f"
then $SHELL -c "x=\$(command -p tee $f </dev/null 2>/dev/null)" || err_exit "$f in command substitution fails"
fi
done