exec: retain exit status of commands, including if they were signaled

This commit is contained in:
Khaïs COLIN 2025-04-02 15:26:11 +02:00
parent 5b7367925f
commit 24ba87abba
Signed by: logistic-bot
SSH key fingerprint: SHA256:RlpiqKeXpcPFZZ4y9Ou4xi2M8OhRJovIwDlbCaMsuAo
2 changed files with 29 additions and 2 deletions

15
test.sh
View file

@ -342,6 +342,21 @@ expecting <<EOF
minishell: : command not found
EOF
when_run <<EOF "exit status of last command is preserved"
echo \$?
ls nonexist
echo \$?
echo hi
echo \$?
EOF
expecting <<EOF
0
ls: cannot access 'nonexist': No such file or directory
2
hi
0
EOF
when_run <<EOF "quoted parentheses are not operators"
echo unclosed '('
EOF