Difference between revisions of "Add line"

From wikieduonline
Jump to navigation Jump to search
 
(One intermediate revision by the same user not shown)
Line 13: Line 13:
 
* [[sed -i]]
 
* [[sed -i]]
 
* [[Ansible: lineinfile]]
 
* [[Ansible: lineinfile]]
 +
* [[rpl]]
 +
* [[Concatenate lines]]
  
 
== See also ==
 
== See also ==

Latest revision as of 10:07, 7 February 2024


grep -qxF 'your text "additional text"' yourfile.txt || echo 'your text "additional text"' >> yourfile.txt


LINE='include "/configs/projectname.conf"'
FILE='lighttpd.conf'
grep -qF -- "$LINE" "$FILE" || echo "$LINE" >> "$FILE"


Related[edit]

See also[edit]

Advertising: