3 ms·
It won't copy stdout to stderr; it'll move stdout to stderr. Stdout will be empty after the redirect, so no, thos won't work :)
by tomsmeding 10y ago
It won't copy stdout to stderr; it'll move stdout to stderr. Stdout will be empty after the redirect, so no, thos won't work :)
- akerl_ 10y agoHave you tried it out? It worked on my system.
- IsmaOlvey 10y agoThe parent is correct, the given command redirects stdout to stderr, it's not copied (so stdout will be empty).
- akerl_ 10y agoAgain, have you tried it? # echo "foo" 1>&2 | sed 's/foo/bar/' foo bar Edit: I've done some more testing, and discovered that the above works on zsh, but not in bash 2nd Edit: Ahha! http://www.cs.elte.hu/zsh-manual/zsh_7.html http://www.cs.elte.hu/zsh-manual/zsh_7.html . So this is because zsh w/ the stock config (MULTIOS option enabled) will open as many outputs as you give it. So it can both copy FD 1's contents to FD 2 and to the pipe'd command.