In bash you can use [[ pattern =~ regex ]]
to match on a conditional:
if [[ "hello world" =~ ^hell ]]; then
echo Match
else
echo No match
fi
In bash you can use [[ pattern =~ regex ]]
to match on a conditional:
if [[ "hello world" =~ ^hell ]]; then
echo Match
else
echo No match
fi