我有10个文件。我可以用@import "path_to_file";
列出它们,我想要实现的是在使用find命令找到它们之后向所有10个文件发送消息。
我尝试了什么,app.scss
可能逻辑上我是对的,但它不起作用。有没有办法只使用find . -type f
和find . -type f -exec echo "This file found" >> {} \;
?
谢谢
答案 0 :(得分:6)
首先完成shell重定向>>
,在{}
启动之前创建一个名为find
的文件,并且字符串(文件的数量在那里)正被写入文件{}
。
你需要:
find . -type f -exec bash -c 'echo "This file found" >>"$1"' _ {} \;