#!/bin/bash

# If the number of arguments is not 1
# something is wrong
if [ $# -ne 1 ] 
then
echo "$0 : You must supply a file *.c"
exit 1
fi

fname=$1
sname=${fname%.c}

# clean exec files
rm $sname.out
#compile
gcc $sname.c -o $sname.out  -lm
#run 
./$sname.out
