【发布时间】:2017-04-13 04:06:45
【问题描述】:
find . -type f -path '*/browser/components/*/*.react.js' -exec sed -i "" '1 i\
import { logRender } from "../../../common/lib/logger";
' {} +
上面的命令只执行一个文件,第一个而不是每个结果来自:
find . -type f -path '*/browser/components/*/*.react.js'
我错过了什么吗?
【问题讨论】:
-
也许问题在于
{} +构造放置了find? 找到的文件列表?.. 考虑将其替换为{} ;。 (像往常一样,您可能需要转义;:{} \;。)
标签: shell unix sed command-line find