shell :将标准输出及标准错误输出写到指定文件$logFile
logFile=/usr/local/log/$today.txt
命令bash demo.sh >> $logFile 2>&1
>>是追加 >是覆盖
1为标准输出stdout、2为标准错误stderr。
shell :将标准输出写到指定文件
bash demo.sh >> $logFile > &1
shell :将标准错误输出写到指定文件及
bash demo.sh >> $logFile > &2