Re: perl one-liner issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



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


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux