The -q means to be quiet or do not output anything to stdout but only exit with a zero (success) as soon as one match is found.
The -F means to interpret the search pattern as a string and not as a regular expression. In this case find the literal string " addprestart.sh " in the file /usr/bin/enigma2_pre_start.sh
I do not know if you missed it but there's an OR logic operator in the command which means if that grep exit with other than zero the echo is executed.
In more human words, append the line /bin/sh /etc/enigma2/addprestart.sh to the script /usr/bin/enigma2_pre_start.sh if it doesn't have it already.
Dear Aia,
Thank you for your last sentence. By the way, I did not understand the function of quiet .
if we do not use quiet , does it print out the grabbed data?
Finally, "double pipe" is the or logic operator, is that true?
If "quiet" ( -q ) isn't used then grep will print any text it finds, to standard output (you can, similarly, make it "quiet" using grep ... >/dev/null). Using -q does not affect the return code of the command. That's what's captured with || . Using || is telling the shell to execute whatever follows, if grep fails (returns a non-zero return code). If you want to execute the "/bin/sh..." on a successful grep match, you should use && instead. Sometimes with these multi-line type of commands, it's simpler just to use an if statement.
grep -q is more than just suppressing any output, it will exist with success as soon as it finds a match, avoiding to continue searching any other lines in the file until it reaches the end of the file. Therefore grep ... > /dev/null will not be the same