"In-Place Editing" using shell redirections instead of sed

Oh, nice one from Stefan Monnier in http://lists.debian.org/debian-user/2011/10/msg01938.html:

    (rm /etc/conf.file;
     while read line; do
         echo ${line/old_word/new_word}
     done >/etc/conf.file) </etc/conf.file

Just in case your sed is not capable of the -i option and you don't want to mess with temporary files.

Tags: