I am trying to grep for a particular word from two files like below. I need to find the word in one of the two files
grep "myWord" file1 file2 && echo 1 or echo 0
The issue is that I have to search in both the files, but sometimes one of these files doesnt exist. So even when the word is present in one of the files it stil returns a 0.
grep "myWord" file1 file2 && echo 1 or echo 0
The issue is that I have to search in both the files, but sometimes one of these files doesnt exist. So even when the word is present in one of the files it stil returns a 0.