On Mon, 07 Nov 2005, Roy Schestowitz announced authoritatively:
> # global - execute command in all subdirectories
Very nifty script, except...
>
> exec 3<&0 # save standard input
> find . -type d -print | # print all directory names
> while read dirname
> do
> (cd $dirname
> exec 0<&3 # restore standard input
unless you actually want to pass that fd 3 to the command I'd make
that line
exec 0<&3 3<&-
> "$@" # run command
> )
> done
> exec 3<&- # close file descriptor
HTH :)
--
`Heinlein is quite competent at putting together sentences, but usually
he also puts together a plot to go with them.' --- Russ Allbery
|
|