You are on page 1of 1

#!

/bin/sh
#comc.sh script that is called by different names
#
lastfile=`ls -t *.c | head -n 1`
command=$0
executable=`expr $lastfile : '\(.*\).c'`
case $command in
*runc) $executable ;;
*comc) cc -o $executable $lastfile &&
echo "$lastfile compiled successfully" ;;
*vic) vi $lastfile;;
esac

You might also like