Subject: regular irrexpressions
To: netbsd-help <netbsd-help@netbsd.org>
From: James K. Lowden <jklowden@schemamania.org>
List: netbsd-help
Date: 10/19/2002 01:02:50
Some days you read the man page, some days it doesn't matter if you do. 
I'm having one of those days.  

What I wanted was a man page in plain old ascii, no mdoc, no terminal
sequences, just the text, ma'am.  Probably there's a groff that does that,
but I haven't found one that preserves the formatting.  It's tempting to
convert it to postscript and use a gs tool to textualize it, but that does
seem like three ways around the barn....

Lacking wits, I tried brute force, emphasis on "brute".  I know this,
because I've been defeated by sed(1) before.  AFAICT, the re_format(7)
page was written by someone who wanted to be quite sure it was accurate,
so much so that he didn't care if anyone could read it.  Nevertheless, I
knew I needed to something I could do in perl with my eyes closed:

man indent |perl -pe's/.\010//g'

But I though, hey, this is why sed(1) was invented, right?  

$ man indent |sed -e's/.\010//g' 
$ man indent |sed 's/.[[:cntrl:]]//' 
$ man indent |sed 's/.[\010]//'
$ man indent |sed 's/(.\010)//'
$ man indent |sed 's/(.[[:cntrl:]])//'

Bwahaha!  sed laughs at my silly inexpressions.  

So.  Did one of you guys log into my box and turn my regex library into a
gatepost, or am I going about this the wrong way?  What ever would *you*
do?  

(In case it matters, I'm ran those in bash on NetBSD 1.5.)

Thanks.

--jkl