diff --git a/src/cmd/ksh93/tests/attributes.sh b/src/cmd/ksh93/tests/attributes.sh index a6661fc31..ee4feee1d 100755 --- a/src/cmd/ksh93/tests/attributes.sh +++ b/src/cmd/ksh93/tests/attributes.sh @@ -408,10 +408,12 @@ typeset groupDB="" userDB="" typeset -l -L1 DBPick="" [[ -n "$groupDB" ]] && err_exit 'typeset -l -L1 causes unwanted side effect' +[[ -v HISTFILE ]] && saveHISTFILE=$HISTFILE || unset saveHISTFILE HISTFILE=foo typeset -u PS1='hello --- ' HISTFILE=foo [[ $HISTFILE == foo ]] || err_exit 'typeset -u PS1 affects HISTFILE' +[[ -v saveHISTFILE ]] && HISTFILE=$saveHISTFILE || unset HISTFILE typeset -a a=( aA= ZQ= bA= bA= bw= Cg= ) typeset -b x diff --git a/src/cmd/ksh93/tests/shtests b/src/cmd/ksh93/tests/shtests index 82ae4c76b..b5d413b2d 100755 --- a/src/cmd/ksh93/tests/shtests +++ b/src/cmd/ksh93/tests/shtests @@ -298,7 +298,8 @@ else trap 'cd / && rm -rf "$tmp"' EXIT fi # for interactive shell ('ksh -i') tests: avoid affecting ~/.sh_history -export HISTFILE=$tmp/sh_history +# (some tests must unset or modify $HISTFILE, so set $HOME instead) +export HOME=$tmp if (( compile )) then if whence $SHCOMP > /dev/null