I’m trying to use SED to make some changes to a CUPS configuration file.
What I want to do is find the following text:
# Restrict access to the server...
<Location />
Order allow, deny
and append this to it:
Allow from all
I’ve tried sed '/# Restrict access to the server...\n<Location />\n Order allow, deny\n/ a\ Allow from all' etc/cups/cupsd.conf but I don’t know how to escape the >, and prepending a backslash to it does not work.
This will work for you:
or alternatively
Example
Note that the order of where the
Allow from allis added is different, although I don’t believe this makes a bit of difference functionality wise.