Use mktemp to create temporary file. Quote variables.