[英]How to write a shell script to append multiple line of data to 3-different file at a time and search if that data already exists and ignore it?
尝试使用: sed -i $ a 'hello' << foo.txt
当我尝试使用多个文件时,我无人看管。 有人请帮忙解决这个问题。 感谢您的回复! 谢谢
查看tee
命令。 就像是
echo "new line" | tee -a file1 file2 file3
为了防止它也发送到标准输出,您可以随后重定向到/dev/null
echo "new line" | tee -a file1 file2 file3 > /dev/null
您可以在其联机帮助页man tee
阅读更多内容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.