Win32
Win32

Reputation: 159

stderr not directed properly

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

Answers (1)

wjandrea
wjandrea

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

Related Questions