delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/07/10/17:58:03

X-Spam-Check-By: sourceware.org
Message-ID: <3058f9b40707101457x34c269e2mea08a1da3a16a1d7@mail.gmail.com>
Date: Tue, 10 Jul 2007 23:57:43 +0200
From: "Ariel Burbaickij" <ariel DOT burbaickij AT gmail DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: find(1) behaving strange or do I miss something
In-Reply-To: <f70tb0$9vb$1@sea.gmane.org>
MIME-Version: 1.0
References: <3058f9b40707101411r3e2b5b07t5419ec901d83e805 AT mail DOT gmail DOT com> <f70tb0$9vb$1 AT sea DOT gmane DOT org>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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 <args> | 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019