#!/bin/bash # This little do-dad will compile source # for me, because i'm soo very lazy! #Program NO_ARGS=0 E_OPTERROR=65 if [ $# -eq "$NO_ARGS" ] # Script invoked with no command-line args? then echo "Usage: `basename $0` hw0" exit $E_OPTERROR # Exit and explain usage, if no argument(s) given. fi gcc -Wall -pedantic -o ~/CS12/$1.out ~/CS12/src/$1.c echo echo "Did that compile ok? Should we attempt to run?(y/n)" echo read compok echo "Program Run: " echo if [ $compok = y ]; then ~/CS12/$1.out fi