delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/01/05:21:58

Date: Wed, 1 Oct 1997 11:20:27 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: "Douglas G. Fowley" <fowley-dg AT salem DOT ge DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: SED problem
In-Reply-To: <3431595A.5610@salem.ge.com>
Message-ID: <Pine.SUN.3.91.971001112001.10422Q-100000@is>
MIME-Version: 1.0

On Tue, 30 Sep 1997, Douglas G. Fowley wrote:

> To answer my own question, I hacked into the source.  In sed.c,
> function compile_regex(), on line 1045, the code to recognize
> '\b', '\f', '\t', and '\r' has been turned off.  When I turn
> the code back on, re-make, and run the test again, I get:
> 
>     C:\temp>sed -e "s/\t/<TAB>/" test
>     this is a TAB \<TAB>\ 
> 
> which is what I expect.  Anyone know why the SED code fragment
> is turned off?

GNU Sed is written to certain specifications, because Sed scripts must
be portable across various implementations of Sed.  The Sed
specifications do NOT include support for \t and the rest of such
characters in regular expressions, because the original Unix Sed
didn't support them.  That is why the code that supports them in GNU
Regex package is turned off.

To find lines with a TAB, type the TAB character on the Sed command
line verbatim.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019