Nice programs often come with heavily marked up sample config files. Sweet! But what if I'm often changing the only uncommented directive on line 300+? Extract live settings with grep:
grep -ve \# /etc/program/config.sample > /etc/program/config
Here -v
says match opposite, and -e
for expression to follow. We also need to escape whatever the comment character/string is with \
.
config is now the same as config.sample with all comments removed.
No Comments Yet!