building LFS: my settings

Bruce Dubbs bdubbs at swbell.net
Fri Jul 6 18:57:32 PDT 2001


Gerard Beekmans wrote:
[deleted]
> >         sed -e 's,^,\\\(^,' -e 's, ,$\\\)\\\|\\\(^,g' -e 's,$,$\\\),'`
> 
> Yeah isn't it great? I have no idea what it does, 
[deleted]

s,^,\\\(^,             -- Put \(^ at the beginning of each line
s, ,$\\\)\\\|\\\(^,g   -- Replace each space with $\)\|\(^
s,$,\\\),              -- Put \) and the end of each line

The script then uses the output as a regular expression.

^ = beginning of line
| = or
$ = end of line
( = begin group
) = end group

All escaped except ^ at the beginning of a group and $ at the end of a group.

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