i want to compare 2 strings
shall i use this command
if [ s1=s2 ]

I generally use the following syntax in Bash

if [[ "${STR3}" == "${STR1973}" ]]; then
   # This is match condition
fi

As an aside, it is generally more useful to you to experiment yourself with these types of trivial problems.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.