request for review of exports.5 update

John Baldwin jhb at freebsd.org
Tue Jul 12 11:44:27 UTC 2011


On Tuesday, July 12, 2011 6:50:09 am Bruce Evans wrote:
> BTW, does anyone know a good way of not seeing duplicates in commands
> like "zgrep -r wrt /usr/share/man"?  find(1) doesn't seem to have any
> flag to suppress duplicates.  du(1) has to know how to not count
> duplicates internally.  I think it as special code for this and there
> is no special support for this in fts(3).  Recently I have been annoyed
> by duplicates under .svn.  I want to type a simple grep -r or
> "find . | xargs grep" without any complicated pattern for the file names
> and not see multiple copies.

I actually have resorted to using specialized commands and aliases for
doing diffs and greps in source trees.  From my .cshrc:

alias cvsdiff   diff -uprN -x \'\*~\' -x \'\*.o\' -x \'\*.orig\' -x \'\*.rej\' 
-x compile -x CVS -x .svn -I \'\\\$FreeBSD\'
alias cvsndiff  diff -upr -x \'\*~\' -x \'\*.o\' -x \'\*.orig\' -x \'\*.rej\' 
-x compile -x CVS -x .svn -I \'\\\$FreeBSD\'

(cvsndiff doesn't include new files)

And a script I keep in my ~/bin:

% cat kgrep
#!/bin/sh
#
# Grep inside a kernel directory skipping compile directories and revision
# control directories

find `ls` ! -path '*compile*' ! -path '*.svn*' ! -path '*CVS*' \
    ! -path '*cscope*' ! -type d -print0 | xargs -0 grep -H "$@"

I also use cscope and xcscope.el to navigate kernel trees which is faster
than grep for cases where it works.

-- 
John Baldwin


More information about the freebsd-fs mailing list