Using sed to enable .htaccess files in Apache config
Solution 1:
sed
supports pattern ranges in this form:
sed '/startpattern/,/endpattern/ <sed-commands>' file
For example:
sed '/<Directory \/var\/www\/>/,/<\/Directory>/ s/AllowOverride None/AllowOverride all/' httpd.conf