OILS / spec / vars-bash.test.sh View on Github | oilshell.org

30 lines, 9 significant
1## oils_failures_allowed: 1
2## compare_shells: bash
3
4#### $SHELL set to login shell
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# make it a login shell
21$SH -l -c "$prog"
22
23## STDOUT:
24SHELL is set
25SHELL is set
26## END
27## N-I dash/mksh/zsh STDOUT:
28SHELL=
29SHELL=
30## END