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

[no subject]



[...]

    Joe>  find . -type d -exec ( pushd {} ; etags *.c ; popd ) ;

Not that the for solution also wouldn't work, but you can also run the
commands inside in a subshell where changes to things such as cwd
don't affect the parent shell.


find . -type d -exec bash -c '( cd '{}'; etags *.c )' \;


Or just use zsh and dispense with the find altogether (this also
checks that there are .c files in the directory before trying to run
etags).


for i in **/*(/); do (cd $i; [[ -n "$(print *.c(N))" ]] &&etags *.c) ; done


-- 
Fletch                | "If you find my answers frightening,       __`'/|
fletch at phydeaux.org   |  Vincent, you should cease askin'          \ o.O'
                      |  scary questions." -- Jules                =(___)=
                      |                                               U


</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<ul><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><a name="00574" href="msg00574.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="msg00571.html">[ale] I need a bash clue.</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00573.html">[ale] Coldfusion MX / Mandrake 10</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00571.html">[ale] I need a bash clue.</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00574.html">[ale] I need a bash clue.</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00572"><strong>Date</strong></a></li>
<li><a href="threads.html#00572"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>

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