【问题标题】:using the find function and the exec flag使用 find 函数和 exec 标志
【发布时间】:2015-04-26 19:53:19
【问题描述】:

这是菜鸟问题: 我正在尝试运行我在网上找到的以下脚本:

find <file name> -type f -exec cat {}

由于某种原因,我收到了 find: missing argument to '-exec' 错误。

我做错了什么?

【问题讨论】:

    标签: bash find exec


    【解决方案1】:

    行尾的分号(带引号或转义)丢失。应该是:

    find <file name> -type f -exec cat {} \;
    

    【讨论】:

    • 感谢您的回答,但仍然没有...没关系,它正在工作!
    • 也许,如果您的 shell 以某种特殊方式解释 {},请引用它,例如 '{}'
    猜你喜欢
    • 2011-08-09
    • 2016-11-09
    • 1970-01-01
    • 2018-03-23
    • 2019-02-19
    • 1970-01-01
    • 1970-01-01
    • 2012-08-17
    • 2011-05-18
    相关资源
    最近更新 更多