find命令exec {}匹配文件夹为空 - 鱼壳

时间:2017-04-24 04:15:58

标签: shell find exec fish

运行简单的find并尝试对结果-exec执行某些命令时,我会得到{}的空值

例如:

$ find ~/folder-with-files -exec echo {} \;
包含3个文件的文件夹上的

将返回空

$
$
$

我在MacOS上使用Fish shell。

1 个答案:

答案 0 :(得分:3)

使用Fish shell时,{}变量必须用引号"{}"

包装
find ~/folder-with-files -exec echo "{}" \;

bashfish shell中正确返回

$ file1.txt
$ file2.txt
$ file3.txt