(echo "abc*****def";echo "def")|awk '/*+/{match($0,"b");print substr($0,RSTART,RLENGTH);} !/abc/{print}'