[thechat] Test replacement

Chrome admin at chrome.me.uk
Thu May 7 05:40:27 CDT 2009


> Hey all
> 
> In the course of writing a script that installs a subdomain I've found
> the
> need to be able to uninstall... Basically the script needs to be able
> to
> remove a standard httpd directive from the conf file... Unfortunately
> my
> *nix skills are still pretty awful (getting there, though)
> 
> Question is how would I remove the following block from a file?
> 
> # --test_subdomain
> <VirtualHost *>
>    # directives
>    # more directives
> </VirtualHost>
> # ++test_subdomain
> 
> The block could be anywhere in the conf file... I've tried, (and will
> continue trying) sed but I'm not having too much (read: any) luck :S
> 
> Many thanks in advance
> 
> Dan

Ooooooops! Sent this to the wrong list!  Meant to send it to Evolt (not
chat)... Sorry, all

Anyway, I fixed this by putting the routine into a PHP script and piping a
`cat` of the file to it... The PHP script reads STDIN then echos the result
which can then be redirected back to the original file

If there is a way to do it with sed I'd love to know it just as a matter of
interest

Cheers

Dan




More information about the thechat mailing list