Is there any argument after ignoring the redirect, or has any unintended consequences?
I was surprised to find that the typo that I made in my bash script did not matter, because it was specified after the redirect. For instance. I expected him to complain about something like this.
./foo.sh > foo2.log whoops I made a typo
But this does not cause any errors. I have to add a semi colon to make it work as a command and an error, something like
./foo.sh > foo2.log; whoops I made a typo
What else surprised me was that Linux did not refuse after redirecting for example.
./foo.sh > foo2.log whoops I made a typo > command_is_still_going.log
absolutely normal and command_is_still_going.log is still created
Is the “exclamations I made a typo” argument completely ignored, or does this lead to some undesirable behavior? Since I try to use it a lot.
source
share