Cygwin 发现错误:缺少-exec的参数

Cygwin 发现错误:缺少-exec的参数,cygwin,Cygwin,我使用了: find ./components -iname \"*.html\" -exec rsync -R '{}' ./build/ \\; 它在Linux中运行得非常好,但现在我无法使用cygwin在windows中运行它。它给出了一个错误: “-exec”缺少参数 甚至使用: find ./components -iname \"*.html\" -exec rsync -R ./build/; 但无法生成html文件 我甚至试过: find ./components -inam

我使用了:

find ./components -iname \"*.html\" -exec rsync -R '{}' ./build/ \\;
它在Linux中运行得非常好,但现在我无法使用cygwin在windows中运行它。它给出了一个错误:

“-exec”缺少参数

甚至使用:

find ./components -iname \"*.html\" -exec rsync -R ./build/;
但无法生成html文件

我甚至试过:

find ./components -iname \"*.html\" -exec rsync -R '{}' ./build/;
但给出了一个错误:

跳过目录


你的逃避似乎是逃避了错误的事情:

  • \\产生
    \
  • 为shell本身生成一个令牌
  • \产生<代码>(使用此代码)
  • 所以你的命令是:

    find ./components -iname "*.html" -exec rsync -R '{}' ./build/ \;