building LFS: my settings

Spall, Michael Michael.Spall at pearsoned-ema.com
Fri Jul 6 06:09:43 PDT 2001


Actually what I wodnered was why would soemone do that.  The string to be
affected is defined right above it, and is never changed dynamically, so why
put the regex's in with a program, they could just as easily have written it
all out by hand.

-----Original Message-----
From: Gerard Beekmans [mailto:gerard at linuxfromscratch.org]
Sent: 06 July 2001 14:07
To: lfs-discuss at linuxfromscratch.org
Subject: Re: building LFS: my settings


On Fri, Jul 06, 2001 at 01:17:34PM +0100, Tommy Wareing wrote:
> On Fri, Jul 06, 2001 at 08:03:50AM -0400, Gerard Beekmans wrote:
> > >         sed -e 's,^,\\\(^,' -e 's, ,$\\\)\\\|\\\(^,g' -e 's,$,$\\\),'`
> > 
> > Yeah isn't it great? I have no idea what it does, but according to
> > /usr/bin/updatedb (where I got the prunepath code from) it works and so
> > far it has done an excellent job at whatever it is doing
> 
> s,^,\\\(^, # Inserts the string "\(^" at ( start of every line.
> 
> s, ,$\\\)\\\|\\\(^,g # replaces every space with the string "$\)\|\(^"
> 
> s,$,$\\\), # appends the string "$\)" at the end of every line.
> 
> The result is that a string of space separated words (such as "a
> string of space separated words") is changed into a set of alternating
> regular expressions, each of which matches its selected word against
> an entire line
>
("\(^a$\)\|\(^string$\)\|\(^of$\)\|\(^space$\)\|\(^separated$\)\|\(^words$\)
")

Wow and who would've come up with that ;)

Must've been somebody bored to tears one day and started regexing.


-- 
Gerard Beekmans
www.linuxfromscratch.org

-*- If Linux doesn't have the solution, you have the wrong problem -*-
-- 
Unsubscribe: send email to lfs-discuss-request at linuxfromscratch.org
and put unsubscribe in the subject header of the message


***********************************************************************

Pearson Education

This email and any files transmitted with it are confidential
and intended solely for the use of the individual or entity
to whom they are addressed.
If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been
swept for the presence of computer viruses.

***********************************************************************


-- 
Unsubscribe: send email to lfs-discuss-request at linuxfromscratch.org
and put unsubscribe in the subject header of the message



More information about the lfs-dev mailing list