Hi,
try it this way:
Code:
sed '/^#$/{N; /# Note that from/ i \
<Location /cgis> \
Options +ExecCGI\
Order allow,deny\
Allow from all\
</Location>\
}' file
As you can see, you do not need all the escape characters. Notice especially, that the last '\' is not needed. In your example it indicates that there is another line following which has to be inserted, too. Thus the
Code:
' /etc/httpd/conf/httpd.conf
is not being interpreted as part of the 'sed' command but as part that needs to be inserted. Also notice, that you need a second search pattern after your 'N' command.
Hope this helps.