[ale] I need a bash clue.

Fletch fletch at phydeaux.org
Thu May 13 23:19:57 EDT 2004


>>>>> "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



More information about the Ale mailing list