1
能否請你解釋這些表情對我說:將數據發送到日誌文件 - shell腳本
cd - 1>> $LOG // Q - what 1 represent ?
./build_we2s all 1>> $LOG 2>> $LOG // Q - what 2 represent ?
能否請你解釋這些表情對我說:將數據發送到日誌文件 - shell腳本
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 => stdout。 2 => stderr。
它們是stdin &標準輸出的默認文件描述符(fd)。