View Single Post
  #1 (permalink)  
Old 03-07-2009, 06:19 PM
cosminnci cosminnci is offline
Junior Member
User
 
Join Date: Jul 2008
Location: SM
OS: CentOs
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
cosminnci is on a distinguished road
Default Comment out lines in .htaccess using sed command

Hello,

I need a script that changes in .htaccess all occurrences of:
php_flag magic_quotes_gpc on
php_value max_execution_time 60
php_flag magic_quotes_runtime off
php_flag asp_tags off
php_flag register_globals on

and other variations of php_*a*
need to insert # in front.

would try with sed
sed -e 's/^php_*a*/#php../g' myfile.txt

what is the correct syntax for this?
could also encounter other "php" occurences in the file.
Reply With Quote