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

Re: Using stupid filenames in shell scripts



On Fri, May 16, 2003 at 08:25:42AM +0100, Colin Watson wrote:
> On Fri, May 16, 2003 at 02:41:03AM +0200, David Jardine wrote:
> > On Thu, May 15, 2003 at 10:57:42PM +0100, Colin Watson wrote:
> > > On Thu, May 15, 2003 at 10:57:40PM +0200, David Jardine wrote:
> > > > 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.
> > 
> > Yes, of course.  I'd actually never heard of the 'y' thing in 
> > sed and my brain(?) had substituted 's' for it.
> 
> It might help to know that that's perl, not sed. :-)

's/help/really confuse you/'

I think I've got it sorted out, but it leads to more 
questions:

1: Do sed and perl each have their own implementations of, 
   for example, 'y///' and 's///', which, as I understand 
   things, are identical between sed and perl?  That would 
   seem a duplication of effort.

2: The "rename" man(1) page, which refers to the command we
   are talking about, is headed "Perl Programmers Reference 
   Guide", which seems completely wrong to me.  

   Perl has a "rename" function with a different syntax for 
   use in its scripts.  "/usr/bin/rename" is indeed a perl 
   script, but does that mean it "is perl"?  Even if it did 
   originate from Larry Wall...

	Can anyone explain where my thinking is going wrong?

> 
> Cheers,
> 
> -- 
> Colin Watson                                  [cjwatson@flatline.org.uk]
> 
> 
> -- 
> To UNSUBSCRIBE, email to debian-user-request@lists.debian.org 
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> 

-- 
David Jardine
"Running Debian/GNU Linux and
loving every minute of it." -Sacher M.



Reply to: