www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/07/04/12:45:04

Date: Fri, 4 Jul 1997 09:43:40 -0700 (PDT)
Message-Id: <199707041643.JAA18466@adit.ap.net>
Mime-Version: 1.0
To: djgpp AT delorie DOT com
From: Nate Eldredge <eldredge AT ap DOT net>
Subject: Escaped chars in regexps

Does anybody know of a way to allow the use of escaped characters (\n, \b,
\t for newline, backspace, tab) in regexps for `grep' and `sed'? I want to
process `man'-type files into ASCII by deleting any character followed by a
backspace. But the seemingly obvious
 sed "s/.\b//" <in >out
doesn't work (since \b matches a line begin or something.) Neither does
 sed "s/.\010//" <in >out
where 010 is octal for the BS char. Under bash, I can do a really ugly
workaround with `echo -e' and back-quotes. But if someone knows a better
way, I'd like to hear it.

Nate Eldredge
eldredge AT ap DOT net



- Raw text -


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