one parameter consists of two steps:
grep -q "yourline" /path/file||sed -i '/..place../ a \the line' file
also possible to do with awk,
save all the lines in the array, while saving, if the line was found, exit. otherwise, add the line to the END{} block to the desired location.
PS You did not indicate in the file where to add this line.
source share