1 #
2 # Tests that explore parsing corner cases.
3
4 #### Length of length of ARGS!
5 fun() { echo ${##}; }
6 fun 0 1 2 3 4 5 6 7 8
7 ## stdout: 1
8
9 #### Length of length of ARGS! 2 digit
10 fun() { echo ${##}; }
11 fun 0 1 2 3 4 5 6 7 8 9
12 ## stdout: 2
13
14 #### Is \r considered whitespace?
15 echo -e 'echo\rTEST' > myscript
16 $SH myscript
17
18 ## status: 127
19 ## STDOUT:
20 ## END
21
22 #### readonly +
23
24 # dash and bash validate this! But not set +
25
26 readonly + >/dev/null
27 echo status=$?
28 ## STDOUT:
29 status=0
30 ## END
31 ## OK bash STDOUT:
32 status=1
33 ## END
34 ## OK dash status: 2
35 ## OK dash stdout-json: ""
36
37 #### set +
38 set + >/dev/null
39 echo status=$?
40 ## STDOUT:
41 status=0
42 ## END