|
发表于 2003-8-6 21:12:00
|
显示全部楼层
Of cause you can redirect stdout and stderr like this:
command &>filename.
But this is not so good.
You will see that the messages from stderr and stdout may cross into each other.
Why? Caz stderr is non-bufferred output, while stdout is bufferred output.
So type command>filename 2 >&1 will be better.
But if you type command>filename 1 >&2 will get the some effect as command &>filename
- We assume the x corrdinate is time zone
- When we type command &>filename, the stream is like this
- Caz, non-buffered output is slow.
- V y
- |
- | s t d e r r
- | stdout
- |
- | x
- |---------------------------------------------------------->(time)
- So you see that stderr and stdout cross into each other.
- But while you type like command>filename 2 >&1
- the stream is like this,Caz, buffered output is fast.
- |
- | stderr
- | stdout
- |
- | x
- |---------------------------------------------------------->(time)
- So this is good.
复制代码 Of cause I left out some other things.
If my understanding is wrong, please correct it. |
|