From: Joseph L. Casale <jcasale@xxxxxxxxxxxxxxxxx> > To: "centos@xxxxxxxxxx" <centos@xxxxxxxxxx> > Sent: Wed, March 16, 2011 8:56:41 PM > Subject: perl one-liner issue > > I am trying to deduce the one liner for an rpm I am packaging to edit a php > configuration file from within my spec. The line I am editing looks like: > $conf['nagios_base'] = "/nagios/cgi-bin"; A sed alternative: sed -i '/nagios_base/ s/\/nagios\/cgi-bin/xxx/' $FILE or more selective: sed -i '/$conf\[.nagios_base.\] = / s/\/nagios\/cgi-bin/xxx/' $FILE JD _______________________________________________ CentOS mailing list CentOS@xxxxxxxxxx http://lists.centos.org/mailman/listinfo/centos