sh: Add two tests for special cases in command substitution that already

work in stable/8.
This commit is contained in:
jilles 2010-12-30 15:04:59 +00:00
parent 64276929de
commit fb3385d473
2 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,17 @@
# $FreeBSD$
# Not required by POSIX (although referenced in a non-normative section),
# but possibly useful.
: hi there &
p=$!
q=$(jobs -l $p)
# Change tabs to spaces.
set -f
set -- $q
r="$*"
case $r in
*" $p "*) ;;
*) echo Pid missing; exit 3 ;;
esac

View File

@ -0,0 +1,11 @@
# $FreeBSD$
set -e
cd /
dummy=$(cd /bin)
[ "$(pwd)" = / ]
v=1
dummy=$(eval v=2)
[ "$v" = 1 ]