blob: d1c4720528a44135c30b0e1d8b5bc9d38cb74d4b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# Interactive: a failing line in $ENV is reported and the shell reads on;
# `exit` there still ends the shell. (A ksh-only builtin in a shared
# startup file must not lock the user out of their account.)
command -v python3 >/dev/null 2>&1 || exit 77
printf 'set -A x -- a\nnosuchcommand\necho after-env\n' >envbad
printf 'echo from-exit-file\nexit 3\n' >envexit
# The two messages are prefixed with the shell's own path, which the test
# cannot know, so drop those lines and compare what is left.
ENV=$PWD/envbad PS1='$ ' HISTFILE='' \
python3 "$TESTS/tools/ptydrive.py" "$TSH" -i >envbad.out 2>&1 <<'END'
expect after-env
send echo alive\r
expect alive
send exit\r
END
grep -v -e '-A: bad option' -e 'nosuchcommand: not found' envbad.out
ENV=$PWD/envexit PS1='$ ' HISTFILE='' \
python3 "$TESTS/tools/ptydrive.py" "$TSH" -i <<'END'
expect from-exit-file
wait 0.3
END
|