#!/usr/bin/ksh
comm="javac -O"
dfex="java"
if let "$# > 1"
then
    $comm $*
    exit 0
fi
if let "$# > 0"
then
    case $1 in
	*.$dfex ) $comm $1 ;;
	*       ) if [ -f $1*.$dfex ]
		  then
		      $comm $1*.$dfex
		  else
		      if [ -f $1 ]
		      then
			  $comm $1
		      else
			  echo Can\'t match file: $1
			  exit 1
		      fi
		  fi
    esac
fi
exit 0
