Simple shell for Ant on Linux

As promised in Simple shell for Ant on Windows i would provide a Linux version of the simple Ant shell. So here is a version based on the Bash shell. I’ve written it using Cygwin, but using it on Linux should not be much of a problem. Of course this Linux version has the same functionality as the Windows version.

#!/bin/bash

project=build.xml

ANT_HOME="/cygdrive/c/programs/apache-ant-1.7.1"

if [ ! -d "$ANT_HOME" ]
then
	echo Error: ANT_HOME does not have a valid value
	read
	exit -1
fi

function help
{
	$ANT_HOME/bin/ant.bat -p -f $project
	echo ""
	echo "Other commands:"
	echo ""
	echo " ?      Show this help."
	echo " help   Show this help."
	echo " q      Stop this shell."
	echo " quit   Stop this shell."
	echo " exit   Stop this shell."
	echo ""
}

# clear the terminal
echo -e "\0033\0143"

# set the terminal title 
echo -en "\033]2;env - A sample Ant shell\007"

echo "For more information/help, type '?' or 'help'."

while true
do
	read -p " $ " command
	
	if [ "$command" == "?" ] || [ "$command" == "help" ]
	then
		help
	else if [ "$command" == "q" ] || [ "$command" == "quit" ] || [ "$command" == "exit" ]
	then
		exit 1
	else
		$ANT_HOME/bin/ant.bat "$command" -f $project -propertyfile env.properties 
	fi
	fi
done