小编Noa*_*can的帖子

bash函数grep --exclude-dir不能正常工作

我在.bashrc中定义了以下函数,但由于某种原因--exclude-dir选项不排除.git目录.谁能看到我做错了什么?如果有帮助,我正在使用Ubuntu 13.10.

function fif # find in files
{
  pattern=${1?"  Usage: fif <word_pattern> [files pattern]"};
  files=${2:+"-iname \"$2\""};

  grep "$pattern" --color -n -H -s $(find . $files -type f) --exclude-dir=.git --exclude="*.min.*"
  return 0;
}
Run Code Online (Sandbox Code Playgroud)

bash grep find

6
推荐指数
2
解决办法
5055
查看次数

标签 统计

bash ×1

find ×1

grep ×1