#!/bin/zsh : ${delim:=---} : ${AWK:=awk} : ${SED:=sed} dst=$1 bin=$0:h:a/bin [[ -d $dst ]] && rm -r $dst mkdir -p $dst || exit $? while IFS= read line; do [[ $line == $delim ]] && break printf '%s\n' $line >>$dst/test.aat || exit $? done cat >$dst/test.data || exit $? cat >$dst/Makefile <test.out test.qawk: test.awk $bin:h/query.pl test.awk >test.qawk # test.qawk: test.awk # awk -f $bin/query.awk test.qawk test.awk: test.mac sed -f $bin/aat_macros.sed test.awk test.mac: test.aat AAT_DEP=test.dep awk -f $bin/aat.awk test.aat >test.mac clean: rm -f test.out test.qawk test.awk test.mac EOF gmake -sC $dst && cat $dst/test.out