以下命令将标准输出与标准错误输出都打印到屏幕和文件
sh filename.sh 2>&1 | tee output
以下命令将标准输出打印到屏幕和文件
sh filename.sh | tee output