- 论坛徽章:
- 145
|
本帖最后由 jason680 于 2013-12-05 11:28 编辑
回复 1# niannian
in my understood
cmd ... 2>output.txt 1>&2
step 1: 2>output.txt
before: 1==> stdout, 2==> stderr
after : 1==> stdout, 2==> output.txt
step 2: 1>&2
before: 1==> stdout, 2==> output.txt
after : 1==> output.txt, 2==> output.txt
Note: you CANNOT use this way, cmd ... 2>output.txt 1>output.txt, in command line
cmd ... 1>&2 2>output.txt
step 1: 1>&2
before: 1==> stdout, 2==> stderr
after : 1==> stderr, 2==> stderr
step 1: 2>output.txt
before: 1==> stderr, 2==> stderr
after : 1==> stderr, 2==> output.txt
|
|