building LFS: my settings

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

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

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
and put unsubscribe in the subject header of the message

More information about the lfs-dev mailing list