interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / tests / osh / bashdiff / cases.txt

76 lines · 2584 bytes Raw Blame History
1# omega#344 bash-differential cases. Grammar: see bashdiff.sh. Run: make osh-bash-diff
2# exit with too many arguments: bash -c stops the whole string at the failed exit (status 1); a script file or stdin
3# continues with the next line.
4### exit-many-c | c | match |
5exit 1 2; echo after
6echo next
7### exit-many-f | f | match |
8exit 1 2; echo after
9echo next
10### exit-many-s | s | match |
11exit 1 2; echo after
12echo next
13### exit-many-c-andor | c | match |
14true && exit 1 2 || echo or; echo after
15echo next
16# An empty expansion before `export` does not make it the declaration builtin: A=$y is split like any argument.
17### export-after-empty-word | c | match |
18y="a b"; e=; $e export A=$y; echo "[$A]"
19### export-quoted-name | c | match |
20y="a b"; "export" A=$y; echo "[$A]"
21### export-plain | c | match |
22y="a b"; export A=$y; echo "[$A]"
23### export-after-redirect | c | match |
24y="a b"; >/dev/null export A=$y; echo "[$A]"
25# bash puts _=<full path of the program> into each child's environment.
26### underscore-child-env | c | match |
27env | grep '^_='
28### underscore-printenv | c | match |
29printenv _
30### underscore-inherited | c | match |
31_=/x/y env | grep '^_='
32### underscore-param | c | refuse=SPECIAL_PARAM |
33echo hi > f; echo $_
34# pwd and cd .. after the working directory was removed while reached through a symlink.
35### pwd-removed-cwd-logical | c | match |
36mkdir real; ln -s real lnk
37%%
38cd lnk; rmdir ../real; pwd; echo "rc=$?"
39### pwd-removed-cwd-physical | c | match |
40mkdir real; ln -s real lnk
41%%
42cd lnk; rmdir ../real; pwd -P; echo "rc=$?"
43### cd-dotdot-removed-cwd | c | match |
44mkdir real; ln -s real lnk
45%%
46cd lnk; rmdir ../real; cd ..; echo "rc=$?"; pwd; ls
47# stderr wording of builtin errors.
48### export-bad-name | c | match |
49export 1x=2; echo "rc=$?"
50### printf-no-format | c | match |
51printf; echo "rc=$?"
52### unset-bad-option | c | match |
53unset -x; echo "rc=$?"
54# Builtin option and operand diagnostics (bash 5.2.21 wording, status 2 for an invalid option).
55### cd-bad-option | c | match |
56cd -x; echo "rc=$?"
57### pwd-bad-option | c | match |
58pwd -x; echo "rc=$?"
59### pwd-LP | c | match |
60mkdir real; ln -s real lnk
61%%
62cd lnk; pwd -LP; pwd -PL; echo "rc=$?"
63### pwd-operand | c | match |
64pwd a b >/dev/null; echo "rc=$?"
65### export-bad-option | c | match |
66export -x; echo "rc=$?"
67### export-eq-name | c | match |
68export =a; echo "rc=$?"
69### printf-bad-option | c | match |
70printf -x; echo "rc=$?"
71### printf-v | c | refuse=option not supported |
72printf -v v %s x
73### unset-bad-name | c | match |
74unset 1x; echo "rc=$?"
75### exit-nonnumeric | c | match |
76exit x