[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



On Thu, 2004-05-13 at 18:30, Joe Knapka wrote:
> I could solve this with a trivial Python program, but I'd rather
> understand how to make bash do it on the command line, if it can be
> done.
> 
> The task is: starting at the current directory, visit every directory
> in the subtree and run "etags" on every .c|.cc|.cpp|.h|.hpp file in
> each directory, leaving the resulting TAGS file in the directory
> containing the source files. I've tried the obvious
> 
>  find . -type d -exec ( pushd {} ; etags *.c ; popd ) ;
> 
> but that fails due to syntax errors on the parens. Escaping the parens
> leads to different syntax errors.
> 
> I *can* do 
> 
>  etags `find . ( -name "*.c" -o -name "*.cc" -o -name "*.cpp" ) -print`
> 
> But then the TAGS file gets created at the root of the tree I'm
> looking at, which isn't what I want. The structure of what I want to
> do is simple: visit each directory, make it current, and run a command
> (which may need to use shell characters). But how to actually feed
> that command to "find" is not obvious to me.
> 
> Yeah, I could read the bash man page for the Nth time, but I'm hoping
> someone here can answer the question more quickly from personal
> knowledge :-)
> 
> Thanks,
> 
> -- Joe
-- 
James P. Kinney III          \Changing the mobile computing world/
CEO & Director of Engineering \          one Linux user         /
Local Net Solutions,LLC        \           at a time.          /
770-493-8244                    \.___________________________./
<a  rel="nofollow" href="http://www.localnetsolutions.com";>http://www.localnetsolutions.com</a>

GPG ID: 829C6CA7 James P. Kinney III (M.S. Physics)
&lt;jkinney at localnetsolutions.com&gt;
Fingerprint = 3C9E 6366 54FC A3FE BA4D 0659 6190 ADC3 829C 6CA7
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part



</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<ul><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><a name="00571" href="msg00571.html">[ale] I need a bash clue.</a></strong>
<ul><li><em>From:</em> jknapka at kneuro.net (Joe Knapka)</li></ul></li>
</ul></li></ul>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00566" href="msg00566.html">[ale] I need a bash clue.</a></strong>
<ul><li><em>From:</em> jknapka at kneuro.net (Joe Knapka)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00566.html">[ale] I need a bash clue.</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00568.html">[ale] Re: important</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00566.html">[ale] I need a bash clue.</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00571.html">[ale] I need a bash clue.</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00567"><strong>Date</strong></a></li>
<li><a href="threads.html#00567"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>