> -----Original Message-----
> From: alex stan [mailto:[EMAIL PROTECTED]] 
> Sent: Monday, July 30, 2001 1:57 PM
> To: [EMAIL PROTECTED]
> Subject: search for string in a file
> 
> 
> I need to search for a string in httpd.conf file , ( the 
> string is : CustomLog /var/log/httpd/site.com/access_log ) 
> and then replace inside them  site.com with site_com. I 
> mentioned that the site.com can take diferent values, such as 
> shop.com , 
>                                              radioq.com
>                                              etc.

Something along the lines of

   perl -pe 's!/([^/]+)\.com!/$1_com! if /^CustomLog/' httpd.conf

should do the trick.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to