1.

Solve : need to search variable?

Answer»

Hi
I am trying to COMPARE a variable NAME is equal to a name or not , but i have a small issue here

My CODE is like

if [ $(var) == "[a-z]_my_test_name_[0-9]"
  ECHO $var;
fi

n this is not working , can someone told me how to do that , the value i m comparing with  is USUALLY like following :
first_my_test_name_120
first_my_test_name_121
second_my_test_name_001


if [ $(var) == '[a-z]_my_test_name_[0-9]'
  echo $var;
fi


its working need to replace the " with the ' .... rest of all the things are correct



Discussion

No Comment Found