如何运行“ find -exec <脚本> {} \;

阿什温

我有一个脚本,可以更改文件夹的文件属性。

这是示例树:

dir 1
    --file 1
    --file 2
    --file 3
dir 2
    --file 1
    --file 2
dir 3
    --file 1
    --file 2
    --file 3

我要在终端上运行此命令,以使每个目录都运行shell脚本(script.sh)

find . -type d -exec ./script.sh {}\;

它不会运行,并且会出现以下错误:

find: missing argument to `-exec'

我在这里想念什么?

芒登

这是因为丢失之间的空间{};

find . -type d -exec ./script.sh {} \;

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章