summaryrefslogtreecommitdiffhomepage
path: root/tests/posix/subshell-edge.sh
blob: 4f6f135431c306d79ac2acc1bf17479e583f2fde (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Subshells and grouping.
x=1; (x=2; echo "in $x"); echo "out $x"
{ x=3; }; echo "group $x"
(exit 7); echo "status=$?"
(cd /; pwd); pwd | grep -c '^/$' >/dev/null || echo "cwd restored"
(trap 'echo sub-exit' EXIT; echo body)
(set -- a b; echo $#); echo $#
f() { echo f; }; (f; unset -f f); f
umask 022; (umask 077; umask); umask
a=$( (echo nested) ); echo "$a"
(echo out; exit 3) | cat; echo "pipe status=$?"
( ( ( echo deep ) ) )
echo $( (exit 4); echo $? )
(false) && echo no || echo "(false) failed"
{ echo a; echo b; } | wc -l | tr -d ' '
( echo "$$" ) | grep -c "^$$\$"