Reputation: 159
the following command:
ls > . 2> error
prints:
bash: .: Is a directory
to the terminal. But since I redirect stderr to 'error' I expect this line to be written into error and not the terminal.
Upvotes: 0
Views: 384
Reputation: 33145
Redirections are done left-to-right, so your stdout redirection fails before your stderr redirection starts. Compare with ls 2> error > .
Upvotes: 5