# NB NB grep on string before you do this, to make sure unique hits # #just modify two places, the grep and the command line to read # #sed -e /string/ file # #this will delete every line that contains string # # loop over all c files looking for the string, # then delete it # are first saved in the bak subdirectory # for FILEN in `grep -l '"dcool.h"' *.c` do BNAME=`basename $FILEN .c` echo $BNAME.c cp $BNAME.c bak/$BNAME.bak # sed -e /'"dcool.h"'/d < ${BNAME}.c > temp.xx mv temp.xx ${BNAME}.c done