1#!/bin/sh
2###########################################################################
3# LPRng - An Extended Print Spooler System
4#
5# Copyright 1988-1995 Patrick Powell, San Diego State University
6#     papowell@sdsu.edu
7# See LICENSE for conditions of use.
8#
9###########################################################################
10# MODULE: TESTSUPPORT/makedb
11# PURPOSE: process a raw configuration or printcap file and
12#  generate a modified form
13# makedb,v 3.1 1996/12/28 21:40:46 papowell Exp
14# Input file format:                 Output File
15# # comment                         #comment
16# #start xx                         #start xx
17# text                              #xx:text      - prefix #xx: 
18# text                              #xx:text
19# #end                              #end
20# #all:text                         #all:all:text - remove # from all
21# 
22########################################################################## 
23awk '
24BEGIN{
25	header = "";
26}
27/^#all/{
28	print header substr( $0, 2 )
29	next;
30}
31/^#start/ {
32	header = "#" $2 ":";
33	print $0;
34	next;
35}
36/^#end/ {
37	header = "";
38	print $0;
39	next;
40}
41{
42	print header $0
43}' $*
44