OILS / spec / subshell.test.sh View on Github | oilshell.org

23 lines, 14 significant
1## compare_shells: dash bash mksh
2
3#### Subshell exit code
4( false; )
5echo $?
6## stdout: 1
7## status: 0
8
9#### Subshell with redirects
10( echo 1 ) > a.txt
11( env echo 2 ) > b.txt
12( env echo 3; ) > c.txt # Sentence in LST
13( echo 4; echo 5 ) > d.txt
14echo status=$?
15cat a.txt b.txt c.txt d.txt
16## STDOUT:
17status=0
181
192
203
214
225
23## END