#!/bin/sh my="abcd" his=`echo "$my" | grep 'bc'` if [[ $my == $his ]] then echo "Ok" else echo "Not ok" fi