Simple if

Hi,
I have a variable (x) that holds a file name - I need to write this:

if x matches the patern *ABC* or the pattern DEF*T then
action A
else
action B
fi

how to do that?

Also, how can i change the or test to AND test?

Thanks.

Here's how you might do it with grep:

echo $x|egrep ".ABC.|.DEF.T"
if [ "$?" -eq 0 ]; then
   echo "Pattern found!"
fi

This would work with strings that have either *ABC* or *DEF*T or both patterns.

Works well - Thanks.