blob: db4cfc5c05b4244a622fa6b39a6c1909d95e4e27 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
# Interactive: a failed `exec` must not end the shell, must report status 127,
# and must leave the shell's own descriptors alone after a redirection.
command -v python3 >/dev/null 2>&1 || exit 77
PS1='$ ' ENV='' HISTFILE='' \
python3 "$TESTS/tools/ptydrive.py" "$TSH" -i <<'END'
send exec /nonexistent/cmd\r
expect $
send echo "rc=$?"\r
expect rc=127
send exec /nonexistent/cmd > out.txt\r
expect $
send echo after\r
expect after
send wc -c < out.txt\r
expect 0
send exit\r
END
|