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

Re: Shell Expansion in Bourne Shell Script Question

>> On Wed, 28 Jul 2010 23:58:11 +0200, 
>> Mart Frauenlob <mart.frauenlob@chello.at> said:

M> One might be better of with some like this:
M>   find /DIR -regextype posix-egrep -regex '.*\.(zip|ZIP)' -exec \
M>     some_command {} +

   If the filelist is potentially too big for the max argument list on the
   system, I would do something like this:

     find $MAGDIR -print | grep -i '\.zip$' | tr0 | xargs -0 some command

   We have a ton of filenames with spaces and other crap, so "tr0" just
   replaces newlines with nulls:

     export PATH
     exec tr '\012' '\000'
     exit 1

Karl Vogel                      I don't speak for the USAF or my company

Q. Why are New Yorkers always depressed?
A. The light at the end of the tunnel is New Jersey.       --Fredrick Homan

Reply to: