shell-independent method: perl -i.bak -0777 -pe 's/CONFIDENTIAL(.*?)own\s+risk/ /s' `cat /home/rjs/heena/edit`