Shells in OCaml
1Test cases from the mind of Ryan Gibb; only those that were designed to torture
2shell users and shell authors alike.
3
4 $ cat > test.sh << EOF
5 >
6 > for arg in \$@; do
7 > echo "No quote: \$arg"
8 > done
9 >
10 > for arg in "\$@"; do
11 > echo "In quotes quote: \$arg"
12 > done
13 > EOF
14
15 $ sh test.sh a b "c d"
16 No quote: a
17 No quote: b
18 No quote: c
19 No quote: d
20 In quotes quote: a
21 In quotes quote: b
22 In quotes quote: c d
23 $ msh test.sh a b "c d"
24 No quote: a
25 No quote: b
26 No quote: c
27 No quote: d
28 In quotes quote: a
29 In quotes quote: b
30 In quotes quote: c d
31