This repository has been archived by the owner. It is now read-only.
Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
36 lines (31 sloc) 402 Bytes
prog=$1
if [ -z $1 ]; then
echo "you must provide a file"
exit 1
fi
if [ ! -f $1 ]; then
echo "file does not exist"
exit 1
fi
extension="${prog##*.}"
case "$extension" in
"c")
gcc $prog && ./a.out
;;
"go")
go run $prog
;;
"pl")
perl $prog
;;
"py")
python $prog
;;
"rb")
ruby $prog
;;
*)
echo "invalid language"
exit 1
;;
esac