Monthly Archives: April 2012

Safer in-place edit?

Sometimes I need to edit a file in batch mode. Say you have /etc/default/foo and you want to change BAR=”-c5″ to BAR=”-c4″. One of the popular methods is using sed in-place edit, like this: sed -i -e ‘s/BAR=”-c5″/BAR=”-c4″/’ foo If … Continue reading

Posted in Misc | Leave a comment