grep: grep for two substrings?
I'm trying to get grep to return true if it finds string xyz or string abc. I know you can do it with individual chars, but can this be accomplished with substrings? If so, how?
I.e.: if cat /file | grep "xyz or abc"; then echo "string contains substring xyz or substring abc" fi |
Try:
Code:
if cat file | grep 'xyz\|abc'; then |
Quote:
|
All times are GMT -5. The time now is 09:24 PM. |