Guest User

Untitled

a guest
Nov 19th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. FILE_PATH=somefile.txt
  4.  
  5. function appendToFile {
  6. echo $@ >> $FILE_PATH
  7. }
  8. function checkBeforeAppend {
  9. (cat $FILE_PATH | grep "$@" && echo "$@ already set") || appendToFile "$@"
  10. }
Add Comment
Please, Sign In to add comment