#! /bin/sh egrep -l 'function (top|back|next|last)' *.html | ( while read F do ( tr -s '\012\015' '\012\012' < $F ; echo '' ) > $F.old touch -r $F $F.old nawk ' { if(match($0,/^function (top|back|next|last)/)==1) printf("function toho%s\n",substr($0,10)); else if(match($0,/onclick=.(top|back|next|last)/)>0) printf("%stoho%s\n",substr($0,1,RSTART+8),substr($0,RSTART+9)); else printf("%s\n",$0); }' $F.old > $F.new done )