# # loop over all h files looking for the string, # then edit the file with sed. all changed files # are first saved in the bak subdirectory # for FILEN in `grep -l struct *.h` do BNAME=`basename $FILEN .h` echo $BNAME.h cp $BNAME.h bak/$BNAME.bak sed -f swapstring.sed < ${BNAME}.h > temp.xx #sed -f command.sed < ${BNAME}.h > temp.xx mv temp.xx ${BNAME}.h done