if you are trying to run a command via sudo and encounter the following error:
sudo: sorry, you must have a tty to run sudo
then you can comment out the following parameter in the /etc/sudoers
#Defaults requiretty
if you are trying to run a command via sudo and encounter the following error:
sudo: sorry, you must have a tty to run sudo
then you can comment out the following parameter in the /etc/sudoers
#Defaults requiretty
This is a sample code to parse a config file in PHP
$mosConfig_CONFIG_IDE=Y
$mosConfig_HOST=localhost
while (!feof($fp)) {
$line = trim(fgets($fp));
if (ereg('\$mosConfig_', $line)) {
$line = ereg_replace ('\$mosConfig_',"",$line);
$pieces = explode("=", $line);
$option = trim($pieces[0]);
$value = trim($pieces[1]);
$value = ereg_replace ("^\'","",$value);
$value = ereg_replace ("\'\;$","",$value);
$config_values[$option] = $value;
}
}
fclose($fp);