OILS / spec / vars-bash.test.sh View on Github | oils.pub

31 lines, 9 significant
1## oils_failures_allowed: 1
2## compare_shells: bash dash mksh zsh
3
4#### $SHELL is set to what is in /etc/passwd
5
6sh=$(which $SH)
7
8unset SHELL
9
10prog='
11if test -n "$SHELL"; then
12 # the exact value is different on CI, so do not assert
13 echo SHELL is set
14 echo SHELL=$SHELL >&2
15fi
16'
17
18$SH -c "$prog"
19
20$SH -i -c "$prog"
21
22# make it a login shell
23$SH -l -c "$prog"
24
25## STDOUT:
26SHELL is set
27SHELL is set
28SHELL is set
29## END
30## N-I dash/mksh/zsh STDOUT:
31## END