I need to add the following line to the end of a config file:
include \"/configs/projectname.conf\"
to a file called lighttpd.conf
Just keep it simple :)
grep + echo should suffice:
grep -qxF 'include "/configs/projectname.conf"' foo.bar || echo 'include "/configs/projectname.conf"' >> foo.bar
-q be quiet-x match the whole line-F pattern is a plain stringEdit: incorporated @cerin and @thijs-wouters suggestions.