mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-06 07:28:09 +01:00
exec: retain exit status of commands, including if they were signaled
This commit is contained in:
parent
5b7367925f
commit
24ba87abba
2 changed files with 29 additions and 2 deletions
15
test.sh
15
test.sh
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue