[英]What does this gcc command mean?
gcc test.c 2> error-msg
谁能解释这个命令的每个部分,例如2>
error-msg
?
I suspect the command to be gcc test.c 2> error-msg
. 我怀疑命令是
gcc test.c 2> error-msg
。 2>
means redirect the error stream of the command gcc test.c
to the file named error-msg
(standard messages will be printed on screen as usual). 2>
表示将命令gcc test.c
的错误流重定向到名为error-msg
的文件(标准消息将照常打印在屏幕上)。
If it is really gcc test.c 2> error -msg
then the executed command will be gcc test.c -msg
and the error stream redirected to the file error
. 如果确实是
gcc test.c 2> error -msg
那么执行的命令将是gcc test.c -msg
,并且错误流重定向到文件error
。 It is not very common to redirect in the middle of a command line. 在命令行中间重定向不是很常见。
gcc test.c 2> error -msg
is the same as gcc test.c -msg 2> error
, which means your shell executes gcc test.c -msg
and redirects its standard error output to file called error
. gcc test.c 2> error -msg
与gcc test.c -msg 2> error
,这意味着您的外壳程序执行gcc test.c -msg
并将其标准错误输出重定向到名为error
文件。 And the error
file will likely contain " error: unrecognized command line option '-msg'" 而且
error
文件可能包含“错误:无法识别的命令行选项'-msg'”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.