954,525 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

shell script

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

vignesh viki
Newbie Poster
5 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
 

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.

L7Sqr
Practically a Master Poster
657 posts since Feb 2011
Reputation Points: 201
Solved Threads: 124
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You