mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
sh: Add two tests for special cases in command substitution that already
work in stable/8.
This commit is contained in:
parent
465e3ccdbb
commit
b0aecb3d03
2 changed files with 28 additions and 0 deletions
17
tools/regression/bin/sh/expansion/cmdsubst8.0
Normal file
17
tools/regression/bin/sh/expansion/cmdsubst8.0
Normal 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
|
||||
11
tools/regression/bin/sh/expansion/cmdsubst9.0
Normal file
11
tools/regression/bin/sh/expansion/cmdsubst9.0
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# $FreeBSD$
|
||||
|
||||
set -e
|
||||
|
||||
cd /
|
||||
dummy=$(cd /bin)
|
||||
[ "$(pwd)" = / ]
|
||||
|
||||
v=1
|
||||
dummy=$(eval v=2)
|
||||
[ "$v" = 1 ]
|
||||
Loading…
Reference in a new issue