1 #### builtin.history.nonposix.test
2 cat > scr <<EOF
3 history | grep history >/dev/null || exit 1
4 echo hi >/dev/null
5 history | grep echo >/dev/null || exit 2
6 history -c
7 history >hist
8 grep echo >/dev/null hist && exit 3
9 set -o nolog
10 history -c
11 echo hello >/dev/null
12 history >hist2
13 grep echo >/dev/null hist2 && exit 4
14 echo ok
15 EOF
16 $TEST_SHELL -i scr 2>/dev/null
17 ## STDOUT:
18 ok
19 ## END
20
21 #### builtin.readonly.assign.interactive.test
22 cat >scr <<'EOF'
23 foo=bar
24 readonly -- foo
25 readonly -- baz=quux
26 echo $foo $baz >&3
27 foo=nope
28 unset baz
29 echo $foo $baz >&3
30 EOF
31 exec 3>&1 1>/dev/null 2>/dev/null
32 $TEST_SHELL -i scr
33 ## STDOUT:
34 bar quux
35 bar quux
36 ## END
37
38 #### parse.error.test
39 echo ')' >scr
40 $TEST_SHELL scr || echo sh ok
41 { echo eval ')' | $TEST_SHELL -i ; } || echo eval ok
42 $TEST_SHELL -c '. ./scr' || echo dot ok
43
44 ## STDOUT:
45 sh ok
46 eval ok
47 dot ok
48 ## END
49
50 #### semantics.interactive.expansion.exit.test
51 PS1="" $TEST_SHELL -i -c 'echo ${x?alas, poor yorick}; echo hello; exit'
52
53 ## STDOUT:
54 hello
55 ## END
56
57 #### sh.interactive.ps1.test
58 echo exit | PS1='$ ' $TEST_SHELL -i
59
60
61 #### sh.ps1.override.test
62 $TEST_SHELL -i <<EOF
63 echo hi
64 echo bye
65 EOF
66
67 PS1='PS1$ ' $TEST_SHELL -i <<EOF
68 echo hi
69 echo bye
70 EOF
71 ## STDOUT:
72 hi
73 bye
74 hi
75 bye
76 ## END
77