File: add-info-toc

package info (click to toggle)
dvipsk-ja 5.95a%2Bjp1.7a-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 5,976 kB
  • ctags: 3,113
  • sloc: ansic: 28,084; sh: 10,210; makefile: 565; perl: 365; csh: 47; awk: 35
file content (21 lines) | stat: -rwxr-xr-x 337 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh
# Copyright 1997 Karl Berry.
	
temp=${TMPDIR-/tmp}/ait.$$

echo Contents: >$temp
echo >>$temp

awk '
	{ prevline = line; line = $0 }
/^\*+$/	{ print prevline }
/^=+$/	{ print "  " prevline }
/^-+$/	{ print "    " prevline }
/^\.+$/	{ print "      " prevline }
' $*>>$temp

echo >>$temp
echo >>$temp
cat $* >>$temp

mv $temp $1