Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
你能向我解释一下这些表达吗:
cd - 1>> $LOG // Q - what 1 represent ? ./build_we2s all 1>> $LOG 2>> $LOG // Q - what 2 represent ?
1 stdout Standard output 2 stderr Standard error cmd 1>> $LOG append stdout (only) to $LOG cmd 1>> $LOG 2>>$LOG append stdout and stderr to $LOG
你可以做
cmd >> $LOG 2>&1
或者
cmd &>>$LOG
也
1 => 标准输出。2 => 标准错误。
它们是标准输入和标准输出的默认文件描述符 (fd)。