From 0c96f9749b47e6ce61275650c80e1a10c6dbb9aa Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Tue, 21 Jul 2020 00:04:33 +0100 Subject: [PATCH] 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. --- src/cmd/ksh93/tests/subshell.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/ksh93/tests/subshell.sh b/src/cmd/ksh93/tests/subshell.sh index edd11b3ba..7279f6cd3 100755 --- a/src/cmd/ksh93/tests/subshell.sh +++ b/src/cmd/ksh93/tests/subshell.sh @@ -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)" || err_exit "$f in command substitution fails" fi done