www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/08/20:15:27

Mime-Version: 1.0
To: jlrubin AT bway DOT net (Josh Rubin), djgpp AT delorie DOT com
From: Nate Eldredge <nate AT cartsys DOT com>
Subject: Re: sed hates me
Date: Mon, 8 Jun 1998 17:08:36 -0700
Message-ID: <19980609000834.AAA6349@ppp100.cartsys.com>

At 03:21  6/7/1998 GMT, Josh Rubin wrote:
>Sed vewsion 1.18 doesn't seem to like backspaces in
>regular expressions. 
>
>sed --expression='s/\b//g'  file > output 
>leaves backspaces untouched. - try it on a formatted man page.
>
>sed --expression='s/x\b//g' 
>removes the 'x' but leaves the backspace!
>
>Am I doing something wrong, or is this a sed bug, or
>this this specific to the DJGPP port?

sed is not, in general, very open to escape sequences in regexps. I've found
it's necessary to use a literal backspace character. In Unix sh or bash, you
can do:

sed `echo -e 's/\b//g'`

Nate Eldredge
nate AT cartsys DOT com



- Raw text -


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