Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • Edit the question and show how the values of nfosys and Infosys are being obtained and what they actually are while the script is being run. Commented Mar 27, 2022 at 15:32
  • consider "nfosys" and "Infosys" simple string with direct assignment to variable Commented Mar 27, 2022 at 15:36
  • == inside of (()) is used for comparing numbers, use [[ instead for strings. Commented Mar 27, 2022 at 15:41
  • See: What is the difference between the Bash operators [[ vs [ vs ( vs ((? Commented Mar 27, 2022 at 15:46
  • if i add square bracket then getting below message -root@ip-10-0-45-44:~# sh -x test.sh + STR_1=nfosys + STR_2=Infosys + [[ nfosys == Infosys ]] test.sh: 6: [[: not found + echo Strings are not equal Strings are not equal root@ip-10-0-45-44:~# Commented Mar 27, 2022 at 15:49