1 ## oils_failures_allowed: 1
2
3 #### Can read from ENV Dict
4 shopt -s ysh:upgrade
5
6 pp test_ (type(ENV))
7 #pp test_ (ENV)
8
9 # Set by the spec test harness
10
11 if (ENV.SH ~~ '*osh') {
12 echo ok
13 }
14
15 #echo SH=$[ENV.SH]
16
17 ## STDOUT:
18 (Str) "Dict"
19 ok
20 ## END
21
22 #### Temp bindings A=a B=b my-command push to ENV dict
23 shopt -s ysh:upgrade
24
25 _A=a _B=b env | grep '^_' | sort
26
27 ## STDOUT:
28 _A=a
29 _B=b
30 ## END
31
32 #### setglobal ENV.PYTHONPATH = 'foo' changes child process state
33 shopt -s ysh:upgrade
34
35 setglobal ENV.PYTHONPATH = 'foo'
36
37 pp test_ (ENV)
38
39 #export PYTHONPATH=zz
40
41 # execute POSIX shell
42 sh -c 'echo pythonpath=$PYTHONPATH'
43
44 ## STDOUT:
45 ## END
46
47 #### export builtin still works
48 shopt -s ysh:upgrade
49
50 export PYTHONPATH='foo'
51
52 #pp test_ (ENV)
53
54 # execute POSIX shell
55 sh -c 'echo pythonpath=$PYTHONPATH'
56
57 ## STDOUT:
58 pythonpath=foo
59 ## END
60