I'm trying to make an automated compiler to invoke gcj to compile classes in folders recursively. It works OK now, but it spits out these ugly error messages when it hits non-.java files and ignores them.
Is there a way I can run an if string contains substring "foo", do this
# $1 is the directory
# $2 is the classpath
for myfilename in $1/* ;
if test -d $myfilename ; then
echo "Entering $myfilename/"
runprocess $myfilename $2
elif $myfilename contains ".java" ; then
echo "Compiling $myfilename"
gcj -C --classpath=$2 $myfilename
echo "Skipping $myfilename"
runprocess $1 $2
The bolded line of code is the pseudocode for what I want to accomplish.