File: man2hlp.sh

package info (click to toggle)
lynx 2.8.9dev11-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 16,556 kB
  • ctags: 12,873
  • sloc: ansic: 133,772; sh: 3,560; makefile: 1,139; perl: 995; yacc: 743
file content (22 lines) | stat: -rwxr-xr-x 607 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
# $LynxId: man2hlp.sh,v 1.3 2008/09/10 13:25:45 tom Exp $
# This script uses rman (Rosetta Man), which complements TkMan, to strip
# nroff headers from a manpage file, and format the result into a VMS help
# file.

LANG=C;		export LANG
LC_ALL=C;	export LC_ALL
LC_CTYPE=C;	export LC_CTYPE
LANGUAGE=C;	export LANGUAGE

for name in $*
do
	NAME=`echo $name |sed -e 's/\.man$/.1/'`
	(echo 1 `echo $NAME | sed -e 's/^.*\///' -e 's/\..*$//' | tr '[a-z]' '[A-Z]'` ; \
	(echo '.hy 0'; cat $name) |\
	nroff -Tascii -man |\
	rman -n$NAME |\
	sed	-e 's/^[1-9].*$//' \
		-e 's/^\([A-Z]\)/2 \1/' |\
	uniq)
done