#!/bin/bash
echo "MIA scripting frontend"
echo "Version 1.0"
echo ""

command=$1
export PATH=".:$PATH"

if [ "$1" == "" ]
then
	echo "`basename $0` <program> [<argument list>]"
	echo ""
	echo "where <argument list> contains all arguments in order,"
	echo "separated by \" \" (space)."
	echo ""
	echo "The PATH variable is temporarily extended by \`pwd\`."
else
	echo -n "Calling $1 with "
	shift

	if [ "$1" == "" ]
	then
		echo "no arguments..."
	else
		echo "arguments $@..."
	fi

	echo ""
fi

while [ "$1" != "" ]
do
	args="$args$1\n"
	shift
done

printf "$args" | $command

