File:  [CSRG BSD Unix] / 43BSDReno / contrib / isode-beta / util / extract.sh
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:56 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD43reno
BSD 4.3reno

: run this script throuh /bin/sh

# A script to pre-process files.
# a bit like ifdef in C compiler - but simpler.
# The idea is you put lines like
# %BEGIN(DEF)%
# %END(DEF)%
# in your file, this script will keep things enclosed in these
# whilst deleting all others.

case $# in
	0)	echo "$0: Usage: $0 Definition [Defs...]" 1>&2; exit 1;;
esac

tfile=/tmp/extr.$$
trap "rm -f $tfile;exit" 1 2 15

echo	'/%WARNING%/s//This file produced automatically, do not edit!/' > $tfile
for i
do
	echo "/%BEGIN($i)%/d"
	echo "/%END($i)%/d"
done >> $tfile

echo "/%BEGIN(.*)%/,/%END(.*)%/d" >> $tfile
sed -f $tfile
rm -f $tfile

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.