
# utility to convert user chapter into new form
echo "Converting user chapter of S functions to new form"
if test ! -d i; then echo "No i/ directory"; exit 1; fi
if test ! -d x; then echo "No x/ directory"; exit 1; fi
# create new part of Smakefile
cp Smakefile oSmakefile	# backup copy
ed - Smakefile <<!
g/i\//s//i./g
w
!
for i in i/*.c
do
	j=`basename $i .c`
	echo "i.$j.C: ; echo '`cat $i`' >i.$j.C" >>Smakefile
done
mv i old.i
echo "Chapter converted.  Try MAKEing a function or two.
If everything works, type:
       rm -r oSmakefile old.i
to get rid of backup copies"
