2010年8月25日水曜日

Find msg in file on Windows

gfind . "(" -path "*/SCCS" -o -path "*/RCS" -o -path "*/CVS" -o -path "*/MCVS" -o -path "*/.svn" -o -path "*/.git" -o -path "*/.hg" -o -path "*/.bzr" -o -path "*/_MTN" -o -path "*/_darcs" -o -path "*/{arch}" ")" -prune -o -type f "(" -iname "*.h" -o -iname "*.c" -o -iname "*.cpp" ")" -exec grep -i -nH -e "find message" {} NUL ";"

gfind = gnu find command
. = start path

2010年8月23日月曜日

EMACS function list in c source file

char foo (int a, int b)
unsigned int bar(int a, int b)
static unsigned short foobar (int a)

grep -nH -x -P "^([\w\d]+|[\w\d]+\s+[\w\d]+|[\w\d]+\s+[\w\d]+\s+[\w\d]+)\s+(.+)\s*\(.+\)\s*$" filename
-n, --line-number print line number with output lines
-H, --with-filename print the filename for each match
-x, --line-regexp force PATTERN to match only whole lines
-P, --perl-regexp PATTERN is a Perl regular expression