[PLUG] Need help with Bash script
Richard Kurth
rkurth at starband.net
Sat Nov 9 00:54:07 UTC 2002
Hello Sandy,
Thank you very very much.
I have been trying to figure this out all day. I have read the sed
manual over and over and still could not figure it out. For the last
hour I have been looking through the sed mailing list.
Friday, November 08, 2002, 4:34:00 PM, you wrote:
SH> You can do it with `sed', Richard...
SH> sed -e '/^### Begin - Control ###$/,/^### End - Control ###$/d' httpd.conf
SH> Redirect stdout from the above to a new file and then mv that to httpd.conf.
SH> Sandy
SH> On Fri, 08 Nov 2002, Richard Kurth wrote:
>> I need some HELP with a bash script that will delete a few lines from
>> a httpd.conf file. In the lines below I need to find and remove all
>> the lines between ### Begin - Control ### and ### End -
>> Control ### including those two lines. I have tried using sed but
>> can't get it to work .
>>
>>
>> RewriteCond %{HTTP_HOST} ^([^:]+)
>> RewriteRule ^/cgi-bin/.cobalt/(.+) proto://servername:81/cgi-bin/.cobalt/$1 [L,R]
>>
>> ### Begin - Control ###
>> RewriteCond %{HTTP_HOST} ^([^:]+)
>> RewriteRule ^/acp/?$ proto://servername:5000/control/index.php
>> RewriteCond %{HTTP_HOST} ^([^:]+)
>> RewriteRule ^/ucp/?$ proto://servername:5000/user/index.php
>> RewriteCond %{HTTP_HOST} ^([^:]+)
>> RewriteRule ^/rcp/?$ proto://servername:5000/resellerpanel/index.php
>> ### End - Control ###
>> ';
>>
>> $rewrite_rules =~ s/servername/%1/g;
>> $rewrite_rules =~ s/proto/$proto/g;
>>
>>
>>
>>
>> --
>> Best regards,
>> Richard mailto:rkurth at starband.net
--
Best regards,
Richard mailto:rkurth at starband.net
More information about the PLUG
mailing list