use temp file to replace contents with awk