regex - how to do "or" in substring matching for bash -
echo `expr "hello" : '\(hi|hello\)'` echo `expr "hi" : '\(hi|hello\)'`
obviously i'm trying match "hello" , "hi" regex hello , hi, neither matches.
how express properly??
alternately, plain globs
case $str in *hi* | *hello*) echo "pleased meet you" esac
Comments
Post a Comment