summary refs log tree commit diff
path: root/bin/cash/tests/expansion/cmdsubst10.0
blob: 4e3b2fc4ba5b4485042f30feb78543a3f29dd8e5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# $FreeBSD: releng/12.0/bin/sh/tests/expansion/cmdsubst10.0 216826 2010-12-30 22:33:55Z jilles $

a1=$(alias)
: $(alias testalias=abcd)
a2=$(alias)
[ "$a1" = "$a2" ] || echo Error at line $LINENO

alias testalias2=abcd
a1=$(alias)
: $(unalias testalias2)
a2=$(alias)
[ "$a1" = "$a2" ] || echo Error at line $LINENO

[ "$(command -V pwd)" = "$(command -V pwd; exit $?)" ] || echo Error at line $LINENO

v=1
: $(export v=2)
[ "$v" = 1 ] || echo Error at line $LINENO

rotest=1
: $(readonly rotest=2)
[ "$rotest" = 1 ] || echo Error at line $LINENO

set +u
: $(set -u)
case $- in
*u*) echo Error at line $LINENO ;;
esac
set +u

set +u
: $(set -o nounset)
case $- in
*u*) echo Error at line $LINENO ;;
esac
set +u

set +u
: $(command set -u)
case $- in
*u*) echo Error at line $LINENO ;;
esac
set +u

umask 77
u1=$(umask)
: $(umask 022)
u2=$(umask)
[ "$u1" = "$u2" ] || echo Error at line $LINENO

dummy=$(exit 3); [ $? -eq 3 ] || echo Error at line $LINENO