记录信息.sh Shell 脚本

Shell 片段 · codes/shell/输入和输出/记录信息.sh · 11 行

源码

#!/usr/bin/env bash

# using the tee command for logging
#将输入一边发送到STDOUT,一边发送到日志文件
tempfile=test
echo "This is the start of the test" | tee $tempfile
echo "This is the second line of the test" | tee -a $tempfile
echo "This is the end line of the test" | tee -a $tempfile


查看上游源码 ↗

内容与示例整理自 dunwu/linux-tutorial,遵循 CC BY-SA 4.0;本站保留原作者署名与许可,命令仅供学习,执行前请核对目标环境。