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