Difference between revisions of "Add line"

From wikieduonline
Jump to navigation Jump to search
Line 2: Line 2:
  
 
  {{add line}}
 
  {{add line}}
 +
 +
 +
LINE='include "/configs/projectname.conf"'
 +
FILE='lighttpd.conf'
 +
grep -qF -- "$LINE" "$FILE" || echo "$LINE" >> "$FILE"
  
  

Revision as of 09:57, 19 April 2023


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


See also

Advertising: