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