Something went wrong. Try again.
Shells in OCaml
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748More fine-grained testing of the possible shell execution options.
First, we test the noglob option.
$ cat > test.sh << EOF > set -f > touch a.txt b.txt > ls *.txt > EOF
$ sh test.sh ls: cannot access '*.txt': No such file or directory [2] $ msh test.sh ls: cannot access '*.txt': No such file or directory [2]
No unset variable option.
$ cat > test.sh << EOF > echo "The variable is: \$UNSETVAR" > set -u > echo \$UNSETVAR > EOF
$ sh test.sh The variable is: test.sh: line 3: UNSETVAR: unbound variable [1] $ msh test.sh The variable is: UNSETVAR: unbound variable [1]
All export options.
$ cat > test.sh << EOF > FOO_MSH=bar > env | grep "FOO_MSH" > set -o allexport > FOO_MSH=bar > env | grep "FOO_MSH" > EOF
$ msh test.sh FOO_MSH=bar