Skip to content

Instantly share code, notes, and snippets.

@simbalinux
Created June 25, 2018 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simbalinux/f0d87b086bd82caa5f348276536fa7dd to your computer and use it in GitHub Desktop.
Save simbalinux/f0d87b086bd82caa5f348276536fa7dd to your computer and use it in GitHub Desktop.
Appending a string to an existing configuration file
global_entry="
global
log 127.0.0.1 local0
log 127.0.0.1 local1 debug
maxconn 45000 # Total Max Connections.
daemon
nbproc 1 # Number of processing cores."
echo "$global_entry"
file=tester
grep -qF "$global_entry" "$file" || echo "$global_entry" | sudo tee --append "$file"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment