1 ## compare_shells: dash bash mksh
2
3 #### Subshell exit code
4 ( false; )
5 echo $?
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
14 echo status=$?
15 cat a.txt b.txt c.txt d.txt
16 ## STDOUT:
17 status=0
18 1
19 2
20 3
21 4
22 5
23 ## END