|
|

楼主 |
发表于 2004-4-13 16:26:00
|
显示全部楼层
最初由 keenor 发表
bash# cat aa.c
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <unistd.h>
- int main()
- {
- write(2, "Hello World!\n", 13);
- return 0;
- }
复制代码
bash# gcc -o aa aa.c
bash# ./aa 2>&1 | tee ret
Hello World!
bash# cat ret
Get the point?
Sorry,mie point
what does aa.c do?
Only deal with the #2 file descriptor?
I meant I need 2 output stream from the #2 file descriptor
one is redirect to a file,
another is just show on the screen
ps. only use shell,not c programme
Thank 4 reply,
Can u give me another good 1?
xiexie |
|