shell编程,记录输出的消息,tee命令
来源:原创
时间:2017-10-26
作者:脚本小站
分类:SHELL
tee 可以将数据即输出在屏幕上又可以保存在文件中,例:date | tee filename
-a 追加数据,默认会替换文本中现有的数据,此选项可以将数据追加到文本中
例1:date | tee -a demo.txt
例2:
echo "This is a message" | tee demo.txt
echo "This is a infomation" | tee -a demo.txt