Skip to Content.
Sympa Menu

baslinux - [BL] man2text1 (was: base64 (MIME) encoder/decoder)

baslinux AT lists.ibiblio.org

Subject: Baslinux mailing list

List archive

Chronological Thread  
  • From: Lee Forrest <lforrestster AT gmail.com>
  • To: baslinux AT lists.ibiblio.org
  • Subject: [BL] man2text1 (was: base64 (MIME) encoder/decoder)
  • Date: Sun, 31 Dec 2006 02:34:06 +0000

On Thu, Dec 28, 2006 at 11:40:36AM -0800, David Moberg wrote:
>> sindi keesan wrote:
[delete]

> I wonder if sed can be used to convert the manroff formatting
> to ANSI codes.

> http://www.google.com/search?hl=en&lr=&q=manroff+to+ansi > >
> Hmm, looks like no one else is doing that. If I have time I might

> be able to write a BL sed script to do that. Or maybe Lee
> could. He seems to know a lot about shell/sed and that sort of
> thing.

This one works for the manpages with plain text tags (are there
more than one kind like that?). I used pure-ftp.8.gz. I don't
have an example of the other kind. Someone can netcat one to me.
(/usr/sbin/send). I'll mail you my IP. Please don't send me any
email attachments. My mail filter will probably just eat it. Or
it might end up in the spam folder at gmail.

Or I'll download it from your website or ftp server.

-------------------------
#!/bin/sh


#This works pretty good on the manpages with plain-text tags
#make excutable with 'chmod +rx man2text1'
#mv to a directory in your PATH; 'echo $PATH'
#usage: man2text1 manpage
#in current directory, still gzipped

gunzip "$1"

file=`echo "$1" | sed 's/\.gz$//'`
file2=`echo "$1" | sed 's/\.[1-8]\.gz$//'`

sed 's/^\.br//; s/^\.SH//; s/\\fB\|\\fR//g; s/^\.TH//; s/^\.B //; \
s/^\.TP//; s/^\.PP//; s/\"//g; s/\\//g; s/^\. *//; s/^BR //; \
s/^I //; s/^IR //; s/ ,/,/g; s/ \./\./g' "$file" | fmt -w 65 > \
"$file 2"

----------------------

[delete]

Lee

--
BasicLinux: Small is Beautiful
http://www.basiclinux.com.ru





Archive powered by MHonArc 2.6.24.

Top of Page