# 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