X-Spam-Check-By: sourceware.org Message-ID: <3058f9b40707101457x34c269e2mea08a1da3a16a1d7@mail.gmail.com> Date: Tue, 10 Jul 2007 23:57:43 +0200 From: "Ariel Burbaickij" To: cygwin AT cygwin DOT com Subject: Re: find(1) behaving strange or do I miss something In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <3058f9b40707101411r3e2b5b07t5419ec901d83e805 AT mail DOT gmail DOT 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 Yeap, works fine. Many thanks. > 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/ > > -- 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/