I'd like to write bash script to parse data from a configuration file. I searched for this but without finding something I could modify to suit my needs.
Joomla! config file:
public $access = '1';
public $debug = '0';
public $debug_lang = '0';
public $dbtype = 'mysqli';
public $host = 'localhost';
public $user = 'template';
public $password = 'template';
public $db = 'template_druha';
public $dbprefix = 'dsf1i_';
public $live_site = '';
public $secret = '2w9gHzPb4HfAs2Y9';
public $gzip = '0';
public $error_reporting = 'default';
I'd like to parse the database credentials on lines with "$user"
and "$password"
and store them in a variable. What is the best practice?