Sponsored Content
Full Discussion: A little help please
Top Forums Shell Programming and Scripting A little help please Post 302145565 by porter on Wednesday 14th of November 2007 04:12:11 PM
Old 11-14-2007
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.

Last edited by porter; 11-14-2007 at 05:26 PM..
 
All times are GMT -4. The time now is 12:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy