diff --git a/bin/sh/Makefile b/bin/sh/Makefile index 337264b54b0c..e3c25e126d8d 100644 --- a/bin/sh/Makefile +++ b/bin/sh/Makefile @@ -62,4 +62,7 @@ syntax.c syntax.h: mksyntax token.h: mktokens sh ${.CURDIR}/mktokens +regress: + cd ${.CURDIR}/../../tools/regression/bin/sh && ${MAKE} SH=${.OBJDIR}/sh + .include diff --git a/tools/regression/bin/sh/Makefile b/tools/regression/bin/sh/Makefile index 2c9ca5943505..82b9c09f2c2e 100644 --- a/tools/regression/bin/sh/Makefile +++ b/tools/regression/bin/sh/Makefile @@ -1,4 +1,7 @@ # $FreeBSD$ +# Allow one to specify the 'sh' to regress. +SH?= /bin/sh + all: - sh regress.sh + env SH=${SH} ${SH} regress.sh diff --git a/tools/regression/bin/sh/builtins/command8.0 b/tools/regression/bin/sh/builtins/command8.0 index 949ffedaee9f..9e3a2b645fbb 100644 --- a/tools/regression/bin/sh/builtins/command8.0 +++ b/tools/regression/bin/sh/builtins/command8.0 @@ -22,7 +22,7 @@ set -e set -- ${SPECIAL} for cmd in "$@" do - sh -c "v=:; while \$v; do v=false; command ${cmd}; done" >/dev/null + ${SH} -c "v=:; while \$v; do v=false; command ${cmd}; done" >/dev/null done while :; do diff --git a/tools/regression/bin/sh/builtins/exec1.0 b/tools/regression/bin/sh/builtins/exec1.0 index 94af2a08f3cd..dd30a4c9aa93 100644 --- a/tools/regression/bin/sh/builtins/exec1.0 +++ b/tools/regression/bin/sh/builtins/exec1.0 @@ -12,7 +12,7 @@ failure() { ) [ $? = 0 ] || failure $LINENO ( - exec sh -c 'exit 42' + exec ${SH} -c 'exit 42' echo bad ) [ $? = 42 ] || failure $LINENO diff --git a/tools/regression/bin/sh/builtins/exec2.0 b/tools/regression/bin/sh/builtins/exec2.0 index a04bf34d4502..3dcb6c41156a 100644 --- a/tools/regression/bin/sh/builtins/exec2.0 +++ b/tools/regression/bin/sh/builtins/exec2.0 @@ -12,7 +12,7 @@ failure() { ) [ $? = 0 ] || failure $LINENO ( - exec -- sh -c 'exit 42' + exec -- ${SH} -c 'exit 42' echo bad ) [ $? = 42 ] || failure $LINENO diff --git a/tools/regression/bin/sh/builtins/fc1.0 b/tools/regression/bin/sh/builtins/fc1.0 index 59d10ef6d2e1..ab7a387b5077 100644 --- a/tools/regression/bin/sh/builtins/fc1.0 +++ b/tools/regression/bin/sh/builtins/fc1.0 @@ -8,7 +8,7 @@ T=$(mktemp -d sh-test.XXXXXX) cd $T mkfifo input output error -HISTFILE=/dev/null sh +m -i output 2>error & +HISTFILE=/dev/null ${SH} +m -i output 2>error & { # Syntax error echo ')' >&3 diff --git a/tools/regression/bin/sh/builtins/fc2.0 b/tools/regression/bin/sh/builtins/fc2.0 index 4f696d480be9..7eb92acc2cdf 100644 --- a/tools/regression/bin/sh/builtins/fc2.0 +++ b/tools/regression/bin/sh/builtins/fc2.0 @@ -8,7 +8,7 @@ T=$(mktemp -d sh-test.XXXXXX) cd $T mkfifo input output error -HISTFILE=/dev/null sh +m -i output 2>error & +HISTFILE=/dev/null ${SH} +m -i output 2>error & exec 3>input { # Command not found, containing slash diff --git a/tools/regression/bin/sh/builtins/trap1.0 b/tools/regression/bin/sh/builtins/trap1.0 index 1a87f4cb7f8c..313f6a387678 100644 --- a/tools/regression/bin/sh/builtins/trap1.0 +++ b/tools/regression/bin/sh/builtins/trap1.0 @@ -4,11 +4,11 @@ test "$(trap 'echo trapped' EXIT; :)" = trapped || exit 1 test "$(trap 'echo trapped' EXIT; /usr/bin/true)" = trapped || exit 1 -result=$(sh -c 'trap "echo trapped" EXIT; /usr/bin/false') +result=$(${SH} -c 'trap "echo trapped" EXIT; /usr/bin/false') test $? -eq 1 || exit 1 test "$result" = trapped || exit 1 -result=$(sh -c 'trap "echo trapped" EXIT; exec /usr/bin/false') +result=$(${SH} -c 'trap "echo trapped" EXIT; exec /usr/bin/false') test $? -eq 1 || exit 1 test -z "$result" || exit 1 diff --git a/tools/regression/bin/sh/builtins/var-assign.0 b/tools/regression/bin/sh/builtins/var-assign.0 index 2e57a3190ca1..ace39c042d5f 100644 --- a/tools/regression/bin/sh/builtins/var-assign.0 +++ b/tools/regression/bin/sh/builtins/var-assign.0 @@ -44,12 +44,12 @@ set -e set -- ${SPECIAL} for cmd in "$@" do - sh -c "VAR=1; VAR=0 ${cmd}; exit \${VAR}" >/dev/null 2>&1 + ${SH} -c "VAR=1; VAR=0 ${cmd}; exit \${VAR}" >/dev/null 2>&1 done # For other built-ins and utilites they do not. set -- ${UTILS} for cmd in "$@" do - sh -c "VAR=0; VAR=1 ${cmd}; exit \${VAR}" >/dev/null 2>&1 + ${SH} -c "VAR=0; VAR=1 ${cmd}; exit \${VAR}" >/dev/null 2>&1 done diff --git a/tools/regression/bin/sh/builtins/var-assign2.0 b/tools/regression/bin/sh/builtins/var-assign2.0 index b7dbaf78c2ab..eafec89a681b 100644 --- a/tools/regression/bin/sh/builtins/var-assign2.0 +++ b/tools/regression/bin/sh/builtins/var-assign2.0 @@ -45,11 +45,11 @@ set -e set -- ${SPECIAL} for cmd in "$@" do - sh -c "VAR=0; VAR=1 command ${cmd}; exit \${VAR}" >/dev/null 2>&1 + ${SH} -c "VAR=0; VAR=1 command ${cmd}; exit \${VAR}" >/dev/null 2>&1 done set -- ${UTILS} for cmd in "$@" do - sh -c "VAR=0; VAR=1 command ${cmd}; exit \${VAR}" >/dev/null 2>&1 + ${SH} -c "VAR=0; VAR=1 command ${cmd}; exit \${VAR}" >/dev/null 2>&1 done diff --git a/tools/regression/bin/sh/errors/assignment-error1.0 b/tools/regression/bin/sh/errors/assignment-error1.0 index c999b41b447f..00eaed9b8671 100644 --- a/tools/regression/bin/sh/errors/assignment-error1.0 +++ b/tools/regression/bin/sh/errors/assignment-error1.0 @@ -16,15 +16,15 @@ SPECIAL="break,\ unset foo" # If there is no command word, the shell must abort on an assignment error. -sh -c "readonly a=0; a=2; exit 0" 2>/dev/null && exit 1 +${SH} -c "readonly a=0; a=2; exit 0" 2>/dev/null && exit 1 # Special built-in utilities must abort on an assignment error. set -- ${SPECIAL} for cmd in "$@" do - sh -c "readonly a=0; a=2 ${cmd}; exit 0" 2>/dev/null && exit 1 + ${SH} -c "readonly a=0; a=2 ${cmd}; exit 0" 2>/dev/null && exit 1 done # Other utilities must not abort; we currently still execute them. -sh -c 'readonly a=0; a=1 true; exit $a' 2>/dev/null || exit 1 -sh -c 'readonly a=0; a=1 command :; exit $a' 2>/dev/null || exit 1 +${SH} -c 'readonly a=0; a=1 true; exit $a' 2>/dev/null || exit 1 +${SH} -c 'readonly a=0; a=1 command :; exit $a' 2>/dev/null || exit 1 diff --git a/tools/regression/bin/sh/errors/backquote-error1.0 b/tools/regression/bin/sh/errors/backquote-error1.0 index 2a40c88e1be7..43e33034af9f 100644 --- a/tools/regression/bin/sh/errors/backquote-error1.0 +++ b/tools/regression/bin/sh/errors/backquote-error1.0 @@ -1,4 +1,4 @@ # $FreeBSD$ -echo 'echo `for` echo ".BAD"CODE.' | sh +m -i 2>&1 | grep -q BADCODE && exit 1 +echo 'echo `for` echo ".BAD"CODE.' | ${SH} +m -i 2>&1 | grep -q BADCODE && exit 1 exit 0 diff --git a/tools/regression/bin/sh/errors/backquote-error2.0 b/tools/regression/bin/sh/errors/backquote-error2.0 index 977c055a2af1..5b49e2be17ce 100644 --- a/tools/regression/bin/sh/errors/backquote-error2.0 +++ b/tools/regression/bin/sh/errors/backquote-error2.0 @@ -1,7 +1,7 @@ # $FreeBSD$ -sh -c 'echo `echo .BA"DCODE.` +${SH} -c 'echo `echo .BA"DCODE.` echo ".BAD"CODE.' 2>&1 | grep -q BADCODE && exit 1 -echo '`"`' | sh -n 2>/dev/null && exit 1 -echo '`'"'"'`' | sh -n 2>/dev/null && exit 1 +echo '`"`' | ${SH} -n 2>/dev/null && exit 1 +echo '`'"'"'`' | ${SH} -n 2>/dev/null && exit 1 exit 0 diff --git a/tools/regression/bin/sh/errors/option-error.0 b/tools/regression/bin/sh/errors/option-error.0 index f599d59072cc..b4b44c4a4062 100644 --- a/tools/regression/bin/sh/errors/option-error.0 +++ b/tools/regression/bin/sh/errors/option-error.0 @@ -35,12 +35,12 @@ UTILS="alias -y,\ set -- ${SPECIAL} for cmd in "$@" do - sh -c "${cmd}; exit 0" 2>/dev/null && exit 1 + ${SH} -c "${cmd}; exit 0" 2>/dev/null && exit 1 done # Other utilities must not abort. set -- ${UTILS} for cmd in "$@" do - sh -c "${cmd}; exit 0" 2>/dev/null || exit 1 + ${SH} -c "${cmd}; exit 0" 2>/dev/null || exit 1 done diff --git a/tools/regression/bin/sh/errors/redirection-error.0 b/tools/regression/bin/sh/errors/redirection-error.0 index d11118a9c9fa..cb8c0b113c13 100644 --- a/tools/regression/bin/sh/errors/redirection-error.0 +++ b/tools/regression/bin/sh/errors/redirection-error.0 @@ -42,12 +42,12 @@ UTILS="alias,\ set -- ${SPECIAL} for cmd in "$@" do - sh -c "${cmd} > /; exit 0" 2>/dev/null && exit 1 + ${SH} -c "${cmd} > /; exit 0" 2>/dev/null && exit 1 done # Other utilities must not abort. set -- ${UTILS} for cmd in "$@" do - sh -c "${cmd} > /; exit 0" 2>/dev/null || exit 1 + ${SH} -c "${cmd} > /; exit 0" 2>/dev/null || exit 1 done diff --git a/tools/regression/bin/sh/errors/redirection-error2.2 b/tools/regression/bin/sh/errors/redirection-error2.2 index 2117ecf07700..32bccd8e784a 100644 --- a/tools/regression/bin/sh/errors/redirection-error2.2 +++ b/tools/regression/bin/sh/errors/redirection-error2.2 @@ -1,4 +1,4 @@ # $FreeBSD$ # sh should fail gracefully on this bad redirect -sh -c 'echo 1 >&$a' 2>/dev/null +${SH} -c 'echo 1 >&$a' 2>/dev/null diff --git a/tools/regression/bin/sh/errors/redirection-error3.0 b/tools/regression/bin/sh/errors/redirection-error3.0 index 93f526c7a125..8a07d037baec 100644 --- a/tools/regression/bin/sh/errors/redirection-error3.0 +++ b/tools/regression/bin/sh/errors/redirection-error3.0 @@ -44,11 +44,11 @@ UTILS="alias,\ set -- ${SPECIAL} for cmd in "$@" do - sh -c "command ${cmd} > /; exit 0" 2>/dev/null || exit 1 + ${SH} -c "command ${cmd} > /; exit 0" 2>/dev/null || exit 1 done set -- ${UTILS} for cmd in "$@" do - sh -c "command ${cmd} > /; exit 0" 2>/dev/null || exit 1 + ${SH} -c "command ${cmd} > /; exit 0" 2>/dev/null || exit 1 done diff --git a/tools/regression/bin/sh/execution/fork1.0 b/tools/regression/bin/sh/execution/fork1.0 index 3ed5de2ec1f1..225a82593231 100644 --- a/tools/regression/bin/sh/execution/fork1.0 +++ b/tools/regression/bin/sh/execution/fork1.0 @@ -1,7 +1,7 @@ # $FreeBSD$ -result=$(sh -c 'ps -p $$ -o comm=') +result=$(${SH} -c 'ps -p $$ -o comm=') test "$result" = "ps" || exit 1 -result=$(sh -c 'ps -p $$ -o comm=; :') +result=$(${SH} -c 'ps -p $$ -o comm=; :') test "$result" = "sh" || exit 1 diff --git a/tools/regression/bin/sh/execution/fork2.0 b/tools/regression/bin/sh/execution/fork2.0 index 35ea3a34df9a..62a25379123c 100644 --- a/tools/regression/bin/sh/execution/fork2.0 +++ b/tools/regression/bin/sh/execution/fork2.0 @@ -1,9 +1,9 @@ # $FreeBSD$ -result=$(sh -c '(/bin/sleep 1)& sleep 0.1; ps -p $! -o comm=; kill $!') +result=$(${SH} -c '(/bin/sleep 1)& sleep 0.1; ps -p $! -o comm=; kill $!') test "$result" = sleep || exit 1 -result=$(sh -c '{ trap "echo trapped" EXIT; (/usr/bin/true); } & wait') +result=$(${SH} -c '{ trap "echo trapped" EXIT; (/usr/bin/true); } & wait') test "$result" = trapped || exit 1 exit 0 diff --git a/tools/regression/bin/sh/execution/func1.0 b/tools/regression/bin/sh/execution/func1.0 index 317b00588686..29fcc077b592 100644 --- a/tools/regression/bin/sh/execution/func1.0 +++ b/tools/regression/bin/sh/execution/func1.0 @@ -1,4 +1,4 @@ # $FreeBSD$ -MALLOC_OPTIONS=J sh -c 'g() { g() { :; }; :; }; g' && -MALLOC_OPTIONS=J sh -c 'g() { unset -f g; :; }; g' +MALLOC_OPTIONS=J ${SH} -c 'g() { g() { :; }; :; }; g' && +MALLOC_OPTIONS=J ${SH} -c 'g() { unset -f g; :; }; g' diff --git a/tools/regression/bin/sh/execution/redir2.0 b/tools/regression/bin/sh/execution/redir2.0 index 697662470d49..1588105f599a 100644 --- a/tools/regression/bin/sh/execution/redir2.0 +++ b/tools/regression/bin/sh/execution/redir2.0 @@ -10,7 +10,7 @@ brokenpipe=0 mkfifo fifo1 fifo2 { { - exec sh -c 'exec &1 | grep -q abcdefg || exit 1 -sh -c 'unset foo; echo ${foo?}' 2>/dev/null && exit 1 -sh -c 'foo=; echo ${foo:?}' 2>/dev/null && exit 1 -sh -c 'foo=; echo ${foo?}' >/dev/null || exit 1 -sh -c 'foo=1; echo ${foo:?}' >/dev/null || exit 1 -sh -c 'echo ${!?}' 2>/dev/null && exit 1 -sh -c ':& echo ${!?}' >/dev/null || exit 1 -sh -c 'echo ${#?}' >/dev/null || exit 1 -sh -c 'echo ${*?}' 2>/dev/null && exit 1 -sh -c 'echo ${*?}' sh x >/dev/null || exit 1 -sh -c 'echo ${1?}' 2>/dev/null && exit 1 -sh -c 'echo ${1?}' sh x >/dev/null || exit 1 -sh -c 'echo ${2?}' sh x 2>/dev/null && exit 1 -sh -c 'echo ${2?}' sh x y >/dev/null || exit 1 +${SH} -c 'unset foo; echo ${foo?}' 2>/dev/null && exit 1 +${SH} -c 'foo=; echo ${foo:?}' 2>/dev/null && exit 1 +${SH} -c 'foo=; echo ${foo?}' >/dev/null || exit 1 +${SH} -c 'foo=1; echo ${foo:?}' >/dev/null || exit 1 +${SH} -c 'echo ${!?}' 2>/dev/null && exit 1 +${SH} -c ':& echo ${!?}' >/dev/null || exit 1 +${SH} -c 'echo ${#?}' >/dev/null || exit 1 +${SH} -c 'echo ${*?}' 2>/dev/null && exit 1 +${SH} -c 'echo ${*?}' ${SH} x >/dev/null || exit 1 +${SH} -c 'echo ${1?}' 2>/dev/null && exit 1 +${SH} -c 'echo ${1?}' ${SH} x >/dev/null || exit 1 +${SH} -c 'echo ${2?}' ${SH} x 2>/dev/null && exit 1 +${SH} -c 'echo ${2?}' ${SH} x y >/dev/null || exit 1 exit 0 diff --git a/tools/regression/bin/sh/expansion/set-u1.0 b/tools/regression/bin/sh/expansion/set-u1.0 index a66bfc9dc99b..763eb7dcfc8f 100644 --- a/tools/regression/bin/sh/expansion/set-u1.0 +++ b/tools/regression/bin/sh/expansion/set-u1.0 @@ -1,29 +1,29 @@ # $FreeBSD$ -sh -uc 'unset foo; echo $foo' 2>/dev/null && exit 1 -sh -uc 'foo=; echo $foo' >/dev/null || exit 1 -sh -uc 'foo=1; echo $foo' >/dev/null || exit 1 +${SH} -uc 'unset foo; echo $foo' 2>/dev/null && exit 1 +${SH} -uc 'foo=; echo $foo' >/dev/null || exit 1 +${SH} -uc 'foo=1; echo $foo' >/dev/null || exit 1 # -/+/= are unaffected by set -u -sh -uc 'unset foo; echo ${foo-}' >/dev/null || exit 1 -sh -uc 'unset foo; echo ${foo+}' >/dev/null || exit 1 -sh -uc 'unset foo; echo ${foo=}' >/dev/null || exit 1 +${SH} -uc 'unset foo; echo ${foo-}' >/dev/null || exit 1 +${SH} -uc 'unset foo; echo ${foo+}' >/dev/null || exit 1 +${SH} -uc 'unset foo; echo ${foo=}' >/dev/null || exit 1 # length/trimming are affected -sh -uc 'unset foo; echo ${#foo}' 2>/dev/null && exit 1 -sh -uc 'foo=; echo ${#foo}' >/dev/null || exit 1 -sh -uc 'unset foo; echo ${foo#?}' 2>/dev/null && exit 1 -sh -uc 'foo=1; echo ${foo#?}' >/dev/null || exit 1 -sh -uc 'unset foo; echo ${foo##?}' 2>/dev/null && exit 1 -sh -uc 'foo=1; echo ${foo##?}' >/dev/null || exit 1 -sh -uc 'unset foo; echo ${foo%?}' 2>/dev/null && exit 1 -sh -uc 'foo=1; echo ${foo%?}' >/dev/null || exit 1 -sh -uc 'unset foo; echo ${foo%%?}' 2>/dev/null && exit 1 -sh -uc 'foo=1; echo ${foo%%?}' >/dev/null || exit 1 +${SH} -uc 'unset foo; echo ${#foo}' 2>/dev/null && exit 1 +${SH} -uc 'foo=; echo ${#foo}' >/dev/null || exit 1 +${SH} -uc 'unset foo; echo ${foo#?}' 2>/dev/null && exit 1 +${SH} -uc 'foo=1; echo ${foo#?}' >/dev/null || exit 1 +${SH} -uc 'unset foo; echo ${foo##?}' 2>/dev/null && exit 1 +${SH} -uc 'foo=1; echo ${foo##?}' >/dev/null || exit 1 +${SH} -uc 'unset foo; echo ${foo%?}' 2>/dev/null && exit 1 +${SH} -uc 'foo=1; echo ${foo%?}' >/dev/null || exit 1 +${SH} -uc 'unset foo; echo ${foo%%?}' 2>/dev/null && exit 1 +${SH} -uc 'foo=1; echo ${foo%%?}' >/dev/null || exit 1 -sh -uc 'echo $!' 2>/dev/null && exit 1 -sh -uc ':& echo $!' >/dev/null || exit 1 -sh -uc 'echo $#' >/dev/null || exit 1 -sh -uc 'echo $1' 2>/dev/null && exit 1 -sh -uc 'echo $1' sh x >/dev/null || exit 1 -sh -uc 'echo $2' sh x 2>/dev/null && exit 1 -sh -uc 'echo $2' sh x y >/dev/null || exit 1 +${SH} -uc 'echo $!' 2>/dev/null && exit 1 +${SH} -uc ':& echo $!' >/dev/null || exit 1 +${SH} -uc 'echo $#' >/dev/null || exit 1 +${SH} -uc 'echo $1' 2>/dev/null && exit 1 +${SH} -uc 'echo $1' ${SH} x >/dev/null || exit 1 +${SH} -uc 'echo $2' ${SH} x 2>/dev/null && exit 1 +${SH} -uc 'echo $2' ${SH} x y >/dev/null || exit 1 exit 0 diff --git a/tools/regression/bin/sh/parameters/mail1.0 b/tools/regression/bin/sh/parameters/mail1.0 index 26308eadbdc4..5791a5accc7c 100644 --- a/tools/regression/bin/sh/parameters/mail1.0 +++ b/tools/regression/bin/sh/parameters/mail1.0 @@ -4,7 +4,7 @@ goodfile=/var/empty/sh-test-goodfile mailfile=/var/empty/sh-test-mailfile T=$(mktemp sh-test.XXXXXX) || exit -MAIL=$mailfile ktrace -i -f "$T" sh -c "[ -s $goodfile ]" 2>/dev/null +MAIL=$mailfile ktrace -i -f "$T" ${SH} -c "[ -s $goodfile ]" 2>/dev/null if ! grep -q $goodfile "$T"; then # ktrace problem rc=0 diff --git a/tools/regression/bin/sh/parameters/mail2.0 b/tools/regression/bin/sh/parameters/mail2.0 index e3b7da341328..343c99de9b27 100644 --- a/tools/regression/bin/sh/parameters/mail2.0 +++ b/tools/regression/bin/sh/parameters/mail2.0 @@ -4,7 +4,7 @@ goodfile=/var/empty/sh-test-goodfile mailfile=/var/empty/sh-test-mailfile T=$(mktemp sh-test.XXXXXX) || exit -ENV=$goodfile MAIL=$mailfile ktrace -i -f "$T" sh +m -i /dev/null 2>&1 +ENV=$goodfile MAIL=$mailfile ktrace -i -f "$T" ${SH} +m -i /dev/null 2>&1 if ! grep -q $goodfile "$T"; then # ktrace problem rc=0 diff --git a/tools/regression/bin/sh/parameters/pwd1.0 b/tools/regression/bin/sh/parameters/pwd1.0 index d54303065ed5..0099379a9d3c 100644 --- a/tools/regression/bin/sh/parameters/pwd1.0 +++ b/tools/regression/bin/sh/parameters/pwd1.0 @@ -3,9 +3,9 @@ cd / || exit 3 failures=0 -[ "$(PWD=foo sh -c 'pwd')" = / ] || : $((failures += 1)) -[ "$(PWD=/var/empty sh -c 'pwd')" = / ] || : $((failures += 1)) -[ "$(PWD=/var/empty/foo sh -c 'pwd')" = / ] || : $((failures += 1)) -[ "$(PWD=/bin/ls sh -c 'pwd')" = / ] || : $((failures += 1)) +[ "$(PWD=foo ${SH} -c 'pwd')" = / ] || : $((failures += 1)) +[ "$(PWD=/var/empty ${SH} -c 'pwd')" = / ] || : $((failures += 1)) +[ "$(PWD=/var/empty/foo ${SH} -c 'pwd')" = / ] || : $((failures += 1)) +[ "$(PWD=/bin/ls ${SH} -c 'pwd')" = / ] || : $((failures += 1)) exit $((failures != 0)) diff --git a/tools/regression/bin/sh/parameters/pwd2.0 b/tools/regression/bin/sh/parameters/pwd2.0 index 29b5531aaa85..2297f8b753d4 100644 --- a/tools/regression/bin/sh/parameters/pwd2.0 +++ b/tools/regression/bin/sh/parameters/pwd2.0 @@ -12,13 +12,13 @@ cd link [ "$PWD" = "$TP/link" ] [ "$(pwd)" = "$TP/link" ] [ "$(pwd -P)" = "$TP/test1" ] -[ "$(sh -c pwd)" = "$TP/link" ] -[ "$(sh -c pwd\ -P)" = "$TP/test1" ] +[ "$(${SH} -c pwd)" = "$TP/link" ] +[ "$(${SH} -c pwd\ -P)" = "$TP/test1" ] cd .. [ "$(pwd)" = "$TP" ] cd -P link [ "$PWD" = "$TP/test1" ] [ "$(pwd)" = "$TP/test1" ] [ "$(pwd -P)" = "$TP/test1" ] -[ "$(sh -c pwd)" = "$TP/test1" ] -[ "$(sh -c pwd\ -P)" = "$TP/test1" ] +[ "$(${SH} -c pwd)" = "$TP/test1" ] +[ "$(${SH} -c pwd\ -P)" = "$TP/test1" ] diff --git a/tools/regression/bin/sh/regress.sh b/tools/regression/bin/sh/regress.sh index a6889af50129..f4c389aa81df 100644 --- a/tools/regression/bin/sh/regress.sh +++ b/tools/regression/bin/sh/regress.sh @@ -1,12 +1,18 @@ # $FreeBSD$ +if [ -z "${SH}" ]; then + echo '${SH} is not set, please correct and re-run.' + exit 1 +fi +export SH=${SH} + COUNTER=1 do_test() { local c c=${COUNTER} COUNTER=$((COUNTER+1)) - sh $1 > tmp.stdout 2> tmp.stderr + ${SH} $1 > tmp.stdout 2> tmp.stderr if [ $? -ne $2 ]; then echo "not ok ${c} - ${1} # wrong exit status" rm tmp.stdout tmp.stderr diff --git a/tools/regression/bin/sh/regress.t b/tools/regression/bin/sh/regress.t index c36d8342d32a..2ae4fdb84a48 100644 --- a/tools/regression/bin/sh/regress.t +++ b/tools/regression/bin/sh/regress.t @@ -1,6 +1,12 @@ #!/bin/sh # $FreeBSD$ +if [ -z "${SH}" ]; then + echo '${SH} is not set, please correct and re-run.' + exit 1 +fi +export SH=${SH} + cd `dirname $0` -sh regress.sh +${SH} regress.sh