1
1
I'm trying to script some changes I need to make to a couple of config files. It's worth mentioning that I'm an expert with neither sed nor awk, though I'm far better with sed.
Right now, I'm doing:
sed '/setting.name/c setting.name: newvalue' </etc/foo.conf >tmpfile.tmp && mv tmpfile.tmp /etc/foo.conf
But surely there's a better way? Perhaps with awk?
2
man sed
tells me that you should use the-i, --in-place
switch (if available in your version of sed. For awk there does not seem to be such an option...maybe you want to write a short script to do it. – Bobby – 2013-05-31T12:15:36.507Argh. RTFM, Joe!! – Joe Fruchey – 2013-05-31T12:34:04.457