OILS / spec / ysh-interactive.test.sh View on Github | oilshell.org

41 lines, 16 significant
1## our_shell: ysh
2
3#### yshrc
4cat >$[ENV.TMP]/yshrc <<EOF
5proc f {
6 if ('foo') {
7 echo yshrc
8 }
9}
10f
11EOF
12$[ENV.SH] --rcfile $[ENV.TMP]/yshrc -i -c 'echo hello'
13## STDOUT:
14yshrc
15hello
16## END
17
18#### YSH_HISTFILE
19
20export YSH_HISTFILE=myhist
21
22# TODO: HISTFILE/YSH_HISTFILE should be looked up in ENV
23#setglobal ENV.YSH_HISTFILE = 'myhist'
24
25rm -f myhist
26
27echo 'echo 42
28echo 43
29echo 44' | $[ENV.SH] --norc -i
30
31cat myhist
32
33## STDOUT:
3442
3543
3644
37^D
38echo 42
39echo 43
40echo 44
41## END