Printing a string when grep does not get a match
grep
exits with non-zero code when nothing found.
From man grep
:
Normally the exit status is 0 if a line is selected, 1 if no lines were selected, and 2 if an error occurred.
So you can use:
grep kwd3 search_file.txt || echo "string"