There is a string $STRING, in which syllables are written with the spaces. If the variable $WORD have at least one syllable in this string, report of this in any way.
There is a string $STRING , in which syllables are written with the spaces.
Share
Your solution checks to see if
$WORDexists in$STRINGwhen it should be the other way around. Try this:As you can see, you can test the result of the
grepwithout having to save the output in a variable.By the way
-nis the same as! -z.