shell :将标准输出及标准错误输出写到指定文件 shell 脚本如下:logFile=/usr/local/log/$today.txt exec >> $logFile 2>&1 1为标准输出stdout、2为标准错误stderr。