Re: replacing a line in a file

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



Jerry Geis wrote:
> I have a large file that has a line like:
>
> bindaddr=0.0.0.0     ; some other text
>
> I want to replace the 0.0.0.0 with my address 192.168.1.8 and remove 
> everything
> else on the line to get:
>
> bindaddr=192.168.1.8
>
> How can I do that?
>
> Thanks,
>
> jerry
>
I finally found a way to do it with sed.
Which is what I tried first but I did not have the . before the $

sed "s/bindaddr=.*/bindaddr=192.168.1.8/"

sorry to have taken tracffic.

Jerry
_______________________________________________
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