File: mansed

package info (click to toggle)
procmail 3.22-20%2Bdeb7u1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 1,988 kB
  • sloc: ansic: 9,885; sh: 1,957; makefile: 132
file content (151 lines) | stat: -rwxr-xr-x 1,933 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
#! /bin/sh
:
#$Id: mansed,v 1.30 2000/09/28 01:23:07 guenther Exp $

if test -z "$IFS"
then IFS=" \
	\

"
  export IFS
fi

test 5 != $# &&
 echo "Don't start this script directly, use \`make'" && exit 1

SHELL=$1
SRC="$2"
DEST="$3"
RM="$4"
DEVNULL=$5
export SHELL SRC DEST RM DEVNULL
TMPF0=/tmp/_mansed.0.$$
TMPF1=/tmp/_mansed.1.$$

if test ! -f "$DEST"
then
 trap "$RM \"$DEST\" $TMPF0 $TMPF1;exit 1" 1 2 3 15
fi

(cat <<\HERE
.\"if n .pl +(135i-\n(.pu)
.de Id
.ds Rv \\$3
.ds Dt \\$4
..
HERE
sed -e '1,/^.ex/ d' -e '/^\.TH/ q' <$SRC
cat <<\HERE
.rn SH Sh
.de SH
.br
.ne 11
.Sh "\\$1"
..
.rn SS Ss
.de SS
.br
.ne 10
.Ss "\\$1"
..
.rn TP Tp
.de TP
.br
.ne 9
.Tp \\$1
..
.rn RS Rs
.de RS
.na
.nf
.Rs
..
.rn RE Re
.de RE
.Re
.fi
.ad
..
.de Sx
.PP
.ne \\$1
.RS
..
.de Ex
.RE
.PP
..
HERE
sed -e '1,/^\.TH/ d' <$SRC
expr "X$DEST" : '.*[18]$' >$DEVNULL && cat <<HERE
.Sh SOURCE
This program is part of the
.I procmail mail-processing-package
(v@PM_VERSION@) available at http://www.procmail.org/ or
ftp.procmail.org in
.BR pub/procmail/ .
.Sh MAILINGLIST
There exists a mailinglist for questions relating to any program in the
procmail package:
.RS
@PM_MAILINGLIST@
.RS
for submitting questions/answers.
.RE
@PM_MAILINGLISTR@
.RS
for subscription requests.
.RE
.PP
.RE
If you would like to stay informed about new versions and official patches send
a subscription request to
.RS
procmail-announce-request@procmail.org
.RE
(this is a readonly list).
HERE
cat <<HERE
.SH AUTHORS
@AUTHORS@
.\".if n .pl -(\n(.tu-1i)
.rm SH
.rn Sh SH
.rm SS
.rn Ss SS
.rm TP
.rn Tp TP
.rm RS
.rn Rs RS
.rm RE
.rn Re RE
HERE
 )| sed -f man.sed.0000 >$TMPF0

if test $? != 0
then
  $RM $TMPF0
  exit 1
fi

for a in man.sed.[0-9]*
do
  case $a in
     man.sed.0000) ;;
     man.sed.????)
	mv $TMPF0 $TMPF1
	if sed -f $a <$TMPF1 >$TMPF0
	then
	:
	else
	   $RM $TMPF1 $TMPF0
	   exit 1
	fi
  esac
done

cat $TMPF0 >"$DEST"
result=$?

$RM $TMPF0 $TMPF1
exit $result