mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-06 07:28:09 +01:00
exec: correct error and return value when cmd is a directory
minishell: /: Is a directory $? = 126
This commit is contained in:
parent
d08c9a6727
commit
386d2bcb3a
2 changed files with 85 additions and 6 deletions
45
test.sh
45
test.sh
|
|
@ -131,6 +131,51 @@ EOF
|
|||
expecting <<EOF
|
||||
EOF
|
||||
|
||||
when_run <<EOF "/ is a directory"
|
||||
/
|
||||
echo \$?
|
||||
EOF
|
||||
expecting <<EOF
|
||||
minishell: /: Is a directory
|
||||
126
|
||||
EOF
|
||||
|
||||
when_run <<EOF "// is a directory"
|
||||
//
|
||||
echo \$?
|
||||
EOF
|
||||
expecting <<EOF
|
||||
minishell: //: Is a directory
|
||||
126
|
||||
EOF
|
||||
|
||||
when_run <<EOF "/. is a directory"
|
||||
/.
|
||||
echo \$?
|
||||
EOF
|
||||
expecting <<EOF
|
||||
minishell: /.: Is a directory
|
||||
126
|
||||
EOF
|
||||
|
||||
when_run <<EOF "/./../../../../.. is a directory"
|
||||
/./../../../../..
|
||||
echo \$?
|
||||
EOF
|
||||
expecting <<EOF
|
||||
minishell: /./../../../../..: Is a directory
|
||||
126
|
||||
EOF
|
||||
|
||||
when_run <<EOF "//////// is a directory"
|
||||
////////
|
||||
echo \$?
|
||||
EOF
|
||||
expecting <<EOF
|
||||
minishell: ////////: Is a directory
|
||||
126
|
||||
EOF
|
||||
|
||||
when_run <<EOF "simple commands are run"
|
||||
echo no files:
|
||||
ls -a
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue