xref: /freebsd/bin/sh/tests/expansion/cmdsubst10.0 (revision ebacd8013fe5f7fdf9f6a5b286f6680dd2891036)
1# $FreeBSD$
2
3a1=$(alias)
4: $(alias testalias=abcd)
5a2=$(alias)
6[ "$a1" = "$a2" ] || echo Error at line $LINENO
7
8alias testalias2=abcd
9a1=$(alias)
10: $(unalias testalias2)
11a2=$(alias)
12[ "$a1" = "$a2" ] || echo Error at line $LINENO
13
14[ "$(command -V pwd)" = "$(command -V pwd; exit $?)" ] || echo Error at line $LINENO
15
16v=1
17: $(export v=2)
18[ "$v" = 1 ] || echo Error at line $LINENO
19
20rotest=1
21: $(readonly rotest=2)
22[ "$rotest" = 1 ] || echo Error at line $LINENO
23
24set +u
25: $(set -u)
26case $- in
27*u*) echo Error at line $LINENO ;;
28esac
29set +u
30
31set +u
32: $(set -o nounset)
33case $- in
34*u*) echo Error at line $LINENO ;;
35esac
36set +u
37
38set +u
39: $(command set -u)
40case $- in
41*u*) echo Error at line $LINENO ;;
42esac
43set +u
44
45umask 77
46u1=$(umask)
47: $(umask 022)
48u2=$(umask)
49[ "$u1" = "$u2" ] || echo Error at line $LINENO
50
51dummy=$(exit 3); [ $? -eq 3 ] || echo Error at line $LINENO
52