Created
May 27, 2014 00:52
-
-
Save itsamenathan/124cd684d2fd58d82063 to your computer and use it in GitHub Desktop.
if with grep -q
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
word=Linux | |
letter_sequence=inu | |
if echo "$word" | grep -q "$letter_sequence" | |
# The "-q" option to grep suppresses output. | |
then | |
echo "$letter_sequence found in $word" | |
else | |
echo "$letter_sequence not found in $word" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment