On Tue, 14 Nov 2000, Lee Howard wrote:

> sed -e "s/\(^.TH*\)4F/\14/g"
>
> be rewritten so that we don't use the \(matching\) as the \1 crashes on
> some SCO and Solaris versions of sed. ???

Just to make sure i'm grokking this right...

Your looking for...

^.T - any occurance of T as the second letter followed by

H* - any number of H's (including none) followed by

4F - a literal "4F"

... and you want to replace it with...

\1 - the same ^.TH* sequence that was found and

4 - the number 4.

... so basically the F gets dropped.

Sounds like their sed is no fun all... do the same thing with perl?

perl -p -e 's/(^.TH*)4F/${1}4/'

Exaclty the same regular expression except perl assumes ()'s are special so
we don't need to quote them and the $1 (first match) needs to be protected
with {} otherwise perl thinks we mean the 14th match as it allows more
than the 9 sed gives us.

Assuming you're stuck with sed that doesn't really help you at all.  Sorry
'bout that... cant see any way to re-write your regex and still do the same
thing.

M.

-- 
WebCentral Pty Ltd              Australia's #1 Internet Web Hosting Company
Level 1, 96 Lytton Road.              Network Operations - Systems Engineer
PO Box 4169, East Brisbane.                          phone: +61 7 3249 2583
Queensland, Australia.                               pgp key id: 0x900E515F



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to