script for find and replace patterns in files