由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - how to redirect the output
相关主题
how to redirect error output under unixHow to redirect error messages to a file?
unix下编译fortran 的错误太多,看不到怎么办?A question about command time
请教How to get rid of the bg job id redirection?Help, What happen to Audio output when using Exceed
How to merge stdout and stderrhelp on building shared object
为什么time命令无法重定向?如何将到stderr的输出重定向到文件?
how to see the output to stderr?how to run background process after logout
有人知道吗?Re: 怎样知道程序运行时间?time 什么来着?关于cxterm的问题
50伪币:请教perl代码差错的问题!多谢啦!Re: how to change all the files .cpp to .C
相关话题的讨论汇总
话题: redirect话题: output话题: stderr话题: stdout话题: command
进入Unix版参与讨论
1 (共1页)
w*****j
发帖数: 49
1
i want to redirect the error message to standard output, how can i do that?
c*****t
发帖数: 1879
2
Normally, both the stderr and stdout output goes to the screen.
If you are redirecting the output to a file or command, you can
redirect stderr by
command > output.txt 2>&1

【在 w*****j 的大作中提到】
: i want to redirect the error message to standard output, how can i do that?
w*****j
发帖数: 49
3
I've tried the following:
ls nothing>error 2>&1
but it seems it doesn't work and told me:
ambiguous output redirect

【在 c*****t 的大作中提到】
: Normally, both the stderr and stdout output goes to the screen.
: If you are redirecting the output to a file or command, you can
: redirect stderr by
: command > output.txt 2>&1

c*****t
发帖数: 1879
4
Which shell are you using?
If you are using tcsh, then it is
command >& output.txt
(both the stdout and stderr are logged into output.txt)

【在 w*****j 的大作中提到】
: I've tried the following:
: ls nothing>error 2>&1
: but it seems it doesn't work and told me:
: ambiguous output redirect

w*****j
发帖数: 49
5
You are right, thanks man

【在 c*****t 的大作中提到】
: Which shell are you using?
: If you are using tcsh, then it is
: command >& output.txt
: (both the stdout and stderr are logged into output.txt)

p*****s
发帖数: 47
6
that depends on shells or systems
try 2>1 , >& 1

【在 w*****j 的大作中提到】
: i want to redirect the error message to standard output, how can i do that?
xt
发帖数: 17532
7
somecommand 2>/dev/stdout

【在 w*****j 的大作中提到】
: i want to redirect the error message to standard output, how can i do that?
1 (共1页)
进入Unix版参与讨论
相关主题
Re: how to change all the files .cpp to .C为什么time命令无法重定向?
[转载] About the historyhow to see the output to stderr?
如何单步执行shell?有人知道吗?Re: 怎样知道程序运行时间?time 什么来着?
which shell is best?50伪币:请教perl代码差错的问题!多谢啦!
how to redirect error output under unixHow to redirect error messages to a file?
unix下编译fortran 的错误太多,看不到怎么办?A question about command time
请教How to get rid of the bg job id redirection?Help, What happen to Audio output when using Exceed
How to merge stdout and stderrhelp on building shared object
相关话题的讨论汇总
话题: redirect话题: output话题: stderr话题: stdout话题: command