|
|
1.1 root 1: : run this script throuh /bin/sh
2:
3: # A script to pre-process files.
4: # a bit like ifdef in C compiler - but simpler.
5: # The idea is you put lines like
6: # %BEGIN(DEF)%
7: # %END(DEF)%
8: # in your file, this script will keep things enclosed in these
9: # whilst deleting all others.
10:
11: case $# in
12: 0) echo "$0: Usage: $0 Definition [Defs...]" 1>&2; exit 1;;
13: esac
14:
15: tfile=/tmp/extr.$$
16: trap "rm -f $tfile;exit" 1 2 15
17:
18: echo '/%WARNING%/s//This file produced automatically, do not edit!/' > $tfile
19: for i
20: do
21: echo "/%BEGIN($i)%/d"
22: echo "/%END($i)%/d"
23: done >> $tfile
24:
25: echo "/%BEGIN(.*)%/,/%END(.*)%/d" >> $tfile
26: sed -f $tfile
27: rm -f $tfile
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.