#### connect to your csci235 directory cd ~/csci235 #### using your favorite text editor, create a C file containing the following code #### I'll call my file funlab.c #include #include int main(int argc, char *argv[]) { for (int i=0; i>>> MYFILE=`echo $1 | cut --fields=1 --delimiter=.` >>>> echo gcc -std=c99 -Wpedantic -o $MYFILE $1 >>>> gcc -std=c99 -Wpedantic -o $MYFILE $1 >>>> } #### Try it out! $$$$ c235 funlab.c $$$$ ls -lt funlab $$$$ funlab #### but.... How to you make this last! $$$$ echo $PATH #### You should see your bin directory! #### Create a file /home/YOURID/bin/c235 with the following contents #! /bin/bash PREFIX=`echo $1 | cut --fields=1 --delimiter=.` echo RUNNING: gcc -std=c99 -Wpedantic -o $PREFIX $1 gcc -std=c99 -Wpedantic -o $PREFIX $1 #### Make sure it is executable $$$$ chmod a+x ~/bin/c235 $$$$ ls -l ~/bin/c235 #### Be sure the shell can find it! And then try it out $$$$ c235 funlab.c $$$$ funlab #### Try to compile your program with the defaults! $$$$ gcc funlab.c #### If you want to be a sys admin, you *must* learn to write scripts. #### Most of written in the Unix shell and it's derivatives; #### however perl (and sometimes Python) are also popular. #### [One UNC Asheville ITS sys admin say he has written 20,000 lines of perl.]