[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
- <!--x-content-type: text/plain -->
- <!--x-date: Thu May 13 23:33:41 2004 -->
- <!--x-from-r13: wxancxn ng xarheb.arg (Xbr Yancxn) -->
- <!--x-message-id: [email protected] -->
- <!--x-reference: [email protected] -->
- <!--x-reference: [email protected] --> "http://www.w3.org/TR/html4/loose.dtd">
- <!--x-subject: [ale] I need a bash clue. -->
- <li><em>date</em>: Thu May 13 23:33:41 2004</li>
- <li><em>from</em>: jknapka at kneuro.net (Joe Knapka)</li>
- <li><em>in-reply-to</em>: <<a href="msg00572.html">[email protected]</a>></li>
- <li><em>references</em>: <[email protected]> <<a href="msg00572.html">[email protected]</a>></li>
- <li><em>subject</em>: [ale] I need a bash clue.</li>
> >>>>> "Joe" == Joe Knapka <jknapka at kneuro.net> writes:
>
> [...]
>
> Joe> find . -type d -exec ( pushd {} ; etags *.c ; popd ) ;
>
> Not that the for solution also wouldn't work,
It actually did work. I'm happily etagging away.
> 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 )' \;
That was what I was looking for. The interaction between find's
command-line parsing and the shell's parsing and expansion is somewhat
confusing.
>
> 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
Looks interesting, though no less opaque than the bash version.
I'll read up on zsh.
Thanks,
-- Joe
--
Resist the feed.
--
If you really want to get my attention, send mail to
jknapka .at. kneuro .dot. net.
</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<ul><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><a name="00577" href="msg00577.html">[ale] I need a bash clue.</a></strong>
<ul><li><em>From:</em> fletch at phydeaux.org (Fletch)</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>
<li><strong><a name="00572" href="msg00572.html">[ale] I need a bash clue.</a></strong>
<ul><li><em>From:</em> fletch at phydeaux.org (Fletch)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00573.html">[ale] Coldfusion MX / Mandrake 10</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00575.html">[ale] [Fwd: Re-Submit: UsBank.com Urgent requirementws]</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00572.html">[ale] I need a bash clue.</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00577.html">[ale] I need a bash clue.</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00574"><strong>Date</strong></a></li>
<li><a href="threads.html#00574"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>
<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>