# fcl == FIND COMPILE LOG # this will work in bash shell only # this script will go in each directory and run gcc command # the directory names are taken from a file "dirNames" one line at time # the output will be stored in an activity file . # errors if any will also be recorded # # CURRENT DIRECTORY == SCRIPTS # #!/bin/sh ##### delete old Log and Activity files ########################## cleanup ################################################################# cd .. cat scripts/dirNames | \ while read line do cd $line #################### check if the file exists ###################################### test -e stack.c if [ "$?" -ne 0 ] then echo $line >> ../scripts/NoFileLog echo $line : File Not Found >> ../scripts/SummaryLog else gcc stack.c -o stack.out -lm 2>>../scripts/ErrorCompileActivity if [ "$?" -ne 0 ] then echo $line : Did Not Compile >> ../scripts/SummaryLog echo $line >> ../scripts/ErrorCompileActivity echo $line >> ../scripts/NoCompileLog else #################### file compiled properly ################# echo $line : File Compiled Properly >> ../scripts/SummaryLog echo $line >> ../scripts/CompileLog fi fi cd .. done #######################################################