mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-06 07:28:09 +01:00
feat(redirections): allow a command composed only of redirections
This commit is contained in:
parent
a9055b4c66
commit
92d647e33c
8 changed files with 58 additions and 17 deletions
37
test.sh
37
test.sh
|
|
@ -1404,4 +1404,41 @@ hello
|
|||
hi
|
||||
EOF
|
||||
|
||||
when_run <<EOF "output redirections with no associated cmd"
|
||||
> outfile1 >> outfile2
|
||||
ls
|
||||
EOF
|
||||
expecting <<EOF
|
||||
outfile1
|
||||
outfile2
|
||||
EOF
|
||||
|
||||
when_run <<EOF "here-doc with no associated cmd"
|
||||
<< eof
|
||||
hello there
|
||||
eof
|
||||
echo \$?
|
||||
EOF
|
||||
expecting <<EOF
|
||||
0
|
||||
EOF
|
||||
|
||||
when_run <<EOF "input redirection with no associated cmd"
|
||||
echo hello > infile
|
||||
< infile
|
||||
echo \$?
|
||||
EOF
|
||||
expecting <<EOF
|
||||
0
|
||||
EOF
|
||||
|
||||
when_run <<EOF "input redirection with no associated cmd where infile does not exist"
|
||||
< infile
|
||||
echo \$?
|
||||
EOF
|
||||
expecting <<EOF
|
||||
minishell: infile: No such file or directory
|
||||
1
|
||||
EOF
|
||||
|
||||
finalize
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue