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

Re: Maybe offtopic: Dealing with filenames with blanks in a script



On Friday 30 April 2004 06:05, Dave Thayer wrote:
> On Thu, Apr 29, 2004 at 04:52:22PM +0100, Thomas Adam wrote:
> >  --- Dave Thorn <davet@fysh.org> wrote:
> > > On Thu, Apr 29, 2004 at 12:05:59PM +0200, Richard Lyons wrote:
> > > > Does that mean I could have a script to convert all those
> > > > horrible filenames people give you from the dark side - the
> > > > ones like "Some Thoughts About Your Proposition.doc".  A simple
> > > > script to
> > >
> > > replace
> > >
> > > > all the spaces with underscores.
> >
> > Something like this:
> >
> > rename 's/ /_/g' *
> >
> > Of course, to be more thorough:
> >
> > find . -type -f -maxdepth 1 -print0 | xargs -0 rename's/ /_/g'
>
> And, to camelCase the name you can use:
> rename 's/_(.)/\u$1/g' *

Thanks everybody!  Those are all useful.  Never heard the expression 
camelCase before either - I like that.  (Of course, if I were writing 
in arabic it would be obvious that it is beautiful.)

-- 
richard



Reply to: