/[hyperestraier]/upstream/0.5.1/filter/estfxmantotxt
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /upstream/0.5.1/filter/estfxmantotxt

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2 - (show annotations)
Fri Jul 29 21:56:53 2005 UTC (18 years, 9 months ago) by dpavlin
File size: 1002 byte(s)
import of HyperEstraier 0.5.1

1 #! /bin/sh
2
3 #================================================================
4 # extfxmantotxt
5 # Convert man (troff-andoc) into plain text.
6 #================================================================
7
8
9 # set variables
10 PATH="$PATH:/usr/local/bin:$HOME/bin:." ; export PATH
11 MANWIDTH=262144 ; export MANWIDTH
12 progname="estfxmantotxt"
13
14
15 # check arguments
16 if [ $# -lt 1 ]
17 then
18 printf '%s: usage: %s infile [outfile]\n' "$progname" "$progname" 1>&2
19 exit 1
20 fi
21 infile="$1"
22 outfile="$2"
23 if [ -n "$ESTORIGFILE" ] && [ -f "$ESTORIGFILE" ]
24 then
25 infile="$ESTORIGFILE"
26 fi
27
28
29 # check the input
30 if [ "!" -f "$infile" ]
31 then
32 printf '%s: %s: no such file\n' "$progname" "$infile" 1>&2
33 exit 1
34 fi
35
36
37 # initialize the output file
38 if [ -n "$outfile" ]
39 then
40 rm -f "$outfile"
41 fi
42
43
44 # function to output
45 output(){
46 if [ -n "$outfile" ]
47 then
48 cat >> "$outfile"
49 else
50 cat
51 fi
52 }
53
54
55 # output the result
56 man "$infile" 2> "/dev/null" | col -b | tr '\t' ' ' | output
57
58
59 # exit normally
60 exit 0
61
62
63
64 # END OF FILE

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26