Quote:
Originally Posted by
immyakram
$ str1=abcd
$ test $str1 = abcd
$ echo $?
0
Good.
Quote:
Originally Posted by
immyakram
$ str1="abcd "
$ test "$str1" = abcd
$ echo $?
1
Yes, this test fails because str1 has a trailing space, ie, the string is five characters long, not four, so does not match.