case is the construct for that in shells of the Bourne family (Bourne, Almquist, ksh, bash, zsh, yash...):
case $file in
*example*) do-something-for-example "$file";;
*) do-something-else-if-not "$file";;
esac
In shells of the csh family (csh, tcsh):
switch ($file:q)
case *example*:
do-something-with $file:q
breaksw
default:
do-something-else-with $file:q
breaksw
endsw
In the fish shell:
switch $file
case '*example*'
do-something-with $file
case '*'
do-something-else-with $file
end
With rc or aganga:
switch ($file) {
case *example*
do-something-with $file
case *
do-something-else-with $file
}
With es:
if {~ $file *example*} {
do-something-with $file
} {
do-something-else-with $file
}