#!/bin/bash echo < WRITELOG sed -i -e "s/\bwrite(\b/WRITELOG(/g" $FILE sed -i -e "s/\bWRITE(\b/WRITELOG(/g" $FILE # print * => WRITELOG(*,*) sed -i -e "s/\bprint\*\,/WRITELOG(*,*) /g" $FILE sed -i -e "s/\bPRINT\*\,/WRITELOG(*,*) /g" $FILE diff $1 $FILE cp -i -u $FILE $1 rm -f $FILE } for FILE in $* ; do replace $FILE done