bash scripting - search a match in a string
Posted on 2004-11-18
I have a string on a variable, I want to search for two matches.. something like this:
var="Take the red pill, or the blue pill"
if [ "red pill" isin $var ]; <-- this I don't know
echo "Somebody mentioned the red pill"
echo "Somebody said something but not about the red pill"
I googled for "search string" and stuff but I get awk and expr funtions that I don't seem to understand (or indeed it isn't me and the result of my search aren't right). Maybe I'm looking wrong. :S
Thaaanks experts :)