Edit Configuration Files with Augeas

From Augeas site:

“Augeas is a configuration editing tool. It parses configuration files in their native formats and transforms them into a tree. Configuration changes are made by manipulating this tree and saving it back into native config files.”

Usage example

Below we select the shellvars lens with allow oar.conf manipulation

 augtool -t 'Shellvars incl /etc/oar/oar.conf'
 
   augtool> print /files/etc/oar/oar.conf/
 
   augtool> get /files/etc/oar/oar.conf/DB_TYPE
   /files/etc/oar/oar.conf/DB_TYPE = "mysql"
 
   augtool> set /files/etc/oar/oar.conf/DB_TYPE Pg
   augtool> save
   Saved 1 file(s)
   augtool>