ChimPansky/42_minishell

Test cases

Closed this issue · 0 comments

redirecting into invalid filenames:

  • tkasbari@c4r7p2:~/projects/common_core/3_circle/42_minishell$ echo hi > $var
    bash: $var: ambiguous redirect

  • tkasbari@c4r7p2:~/projects/common_core/3_circle/42_minishell$ echo hi > ""
    bash: : No such file or directory

  • tkasbari@c4r7p2:~/projects/common_core/3_circle/42_minishell$ echo hi >
    bash: syntax error near unexpected token `newline'

  • tkasbari@c4r7p2:~/projects/common_core/3_circle/42_minishell$ echo hi > $var | echo hi > $var

bash: $var: ambiguous redirect
bash: $var: ambiguous redirect

  • tkasbari@c4r7p2:~/projects/common_core/3_circle/42_minishell$ echo hi > 1.txt | echo hi > $var

bash: $var: ambiguous redirect

seems like we have to generate these error messages when trying to open the fds in executor....

  • this:
tkasbari@c4r3p8:~$ var="test file"
tkasbari@c4r3p8:~$ echo ho >"$var"
tkasbari@c4r3p8:~$ echo hi >$var
bash: $var: ambiguous redirect
tkasbari@c4r3p8:~$ var="\"abc cde\""
tkasbari@c4r3p8:~$ echo $var
"abc cde"