我想在日志文件中以及提示时打印一条 echo 语句。
echo "Installation complete" #This is printed on prompt
echo "Installation complete" >> deploy.log #This is printed in log
我想用一个命令来完成这个任务。这是可能的还是我太雄心勃勃了?
答案1
echo "Installation complete" | tee -a deploy.log
我想在日志文件中以及提示时打印一条 echo 语句。
echo "Installation complete" #This is printed on prompt
echo "Installation complete" >> deploy.log #This is printed in log
我想用一个命令来完成这个任务。这是可能的还是我太雄心勃勃了?
echo "Installation complete" | tee -a deploy.log