- To: "henry" <henry@xxxxxxxxxxxxxx>
- Subject: [SLUG] Re: ask help(shell-writing)
- From: Angus Lees <gus@xxxxxxxxxxx>
- Date: Fri Jun 21 12:47:02 2002
- Cc: <slug@xxxxxxxxxxx>
- User-agent: Wanderlust/2.9.9 (Unchained Melody) XEmacs/21.4 (Common Lisp)
At Wed, 19 Jun 2002 18:51:20 +0800, henry wrote:
> I need to tag *.c *.h *.cpp, but it (as follows) fail
> find . -name ( "*.[c|h]" -or "*.cpp" ) | xargs etags
you're confusing regex and shell globbing expressions - and find(1)'s
distributive properties.
> I get a file-list to tag , but I dont know how to feed it to etags ?
rm TAGS
find . \( -name '*.{c,h}' -o -name '*.cpp' \) -print | xargs etags -a
for a long enough list, xargs may run etags more than once. hence the
need for "etags -a" (and the "rm TAGS" first).
NB: if you're using automake-generated Makefiles, there's already a
"make TAGS" target (that's more sophisticated than the above too).
if you have a large code tree, it's probably worthwhile looking at the
make rules it uses.
--
- Gus