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

Re: Using stupid filenames in shell scripts



On Sat, May 17, 2003 at 11:03:28AM +0100, Colin Watson wrote:
> On Sat, May 17, 2003 at 12:24:05AM +0200, David Jardine wrote:
> > 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:
> > > > 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.
> 
> I'm not sure that's really a meaningful question. 

What a nice way to put it! :)

>                                                   sed and perl are
> completely different languages that happen to share a little common
> syntax. Regular expressions (the left-hand sides of y/// and s///) are
> not the same between sed and perl, although superficially they look
> similar. See perlre(1) for details.

Well, the answer's meaningful enough - to me, at any rate.  
I had wondered whether perl used calls to sed or awk or whatever 
but okay, it doesn't.  Thanks.
> 
> > 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...
> 
> /usr/bin/rename is part of the Perl distribution, as 'dpkg -S' will tell
> you.

So it's in the Perl package and it's a perl script and it uses 
the perl function.  But what I mean is that I don't feel I'm 
"doing  something in perl" when I run "rename" from the command 
line, and so it's not a "Perl Programmers Reference Guide" I 
need to consult.

> 
> 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: