X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Matthew Woehlke Subject: Re: find(1) behaving strange or do I miss something Date: Tue, 10 Jul 2007 16:22:40 -0500 Lines: 27 Message-ID: References: <3058f9b40707101411r3e2b5b07t5419ec901d83e805 AT mail DOT gmail DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.12) Gecko/20070509 Thunderbird/1.5.0.12 Mnenhy/0.7.4.0 In-Reply-To: <3058f9b40707101411r3e2b5b07t5419ec901d83e805@mail.gmail.com> X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Ariel Burbaickij wrote: > Hello all, > following situation: > I hate white spaces in file and cranked tiny bashscript for replacing > them that goes like this: > for i in `find . -type f` > do > mv $i /some_directory/`echo $i|sed 's/ /_/g'` > done > > On this I get complaints from mv that it cannot find files that are > basically parts of the > name with spaces like this: > [snip] Not that this has anything to do with Cygwin, but... well, yes, because bash is splitting at whitespace :-). You probably want something like this: find | while read i ; do mv "$i" "${i// /_}" ; done (note that "$i" must be quoted also!) -- Matthew "What is a release plan, anyway?" -- Oswald Buddenhagen ...who I'm sure did not mean it seriously ;-) -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/