#!/bin/bash

PD=@PD@
export AXIOM=/usr/lib/$PD;export PATH=$AXIOM/bin:$PATH

if [ $# -gt 0 ] ; then
	j=$@
else
	j=""
	for i in /usr/lib/$PD/input/*.input; do j="$j $(basename $i | sed 's,\.input$,,1')"; done
fi

k=$(tempfile --suffix=.input)
trap "rm -f $k" exit

for i in $j ; do 
	cat >$k <<EOF
)set message test on
)set message auto off
)read /usr/lib/$PD/input/$i.input
)lisp (by)
EOF

	echo "systemCommand \"read $k\"" | /usr/lib/$PD/bin/AXIOMsys

done
