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

Re: Using stupid filenames in shell scripts



On Thu, May 15, 2003 at 10:57:40PM +0200, David Jardine wrote:
> On Thu, May 15, 2003 at 04:39:52PM +0100, Colin Watson wrote:
> > On Thu, May 15, 2003 at 04:13:27PM +0200, Joerg Johannes wrote:
> > > If you are going to produce new mp3's, you will consider naming
> > > them without spaces. Just replace all spaces with underscores _ .
> > > If you want to know how to rename all existing files, wait for
> > > Colin Watson to answer, he is something like the "script guru"
> > > over here.
> > 
> > Mmph, am I? Gosh. Personally I'd be inclined to use:
> > 
> >   rename 'y/ /_/' *.mp3
> 
> Shouldn't that be
> 
> 	rename 'y/ /_/g' *.mpg   ?

Why? Firstly, y/// doesn't take a /g option (try it, or read perlop(1));
secondly, he asked for *.mp3 rather than *.mpg.

Cheers,

-- 
Colin Watson                                  [cjwatson@flatline.org.uk]



Reply to: