[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] I need a bash clue.
- Subject: [ale] I need a bash clue.
- From: fletch at phydeaux.org (Fletch)
- Date: Thu May 13 23:19:57 2004
- In-reply-to: <[email protected]> (Joe Knapka's message of "13 May 2004 16:30:43 -0600")
- References: <[email protected]>
>>>>> "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, 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