On Thu, May 15, 2014 at 3:53 PM, Norihiro Tanaka <nori...@kcn.ne.jp> wrote:

>
> Even if I define an alias "grep='grep -d skip'", when "find . | xargs grep"
> doesn't ignore directories.
>

Since find does output directories, and clearly you don't want to grep on
them, why not just do something like

find . ! -type d | xargs grep

To be even safer and work with any file name (containing even newlines),
you actually need to do

find . ! -type d -print0 | xargs -0 grep

So maybe you just want to alias this whole thing :-)

I don't think this a reason to keep GREP_OPTIONS, but like I said I don't
mind if it is kept if at least people are warned about how it might break
shell scripts.


-- 
Nadav Har'El
n...@cloudius-systems.com

Reply via email to