The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 01-28-2008
jaduks's Avatar
jaduks jaduks is offline
Registered User
  
 

Join Date: Aug 2007
Location: Assam,India
Posts: 167
The one that yogesh is mentioning above should work for both numeric and string comparison. A different look of the same.


Code:
$ VAR=25
$ [ $VAR == "25" ] && echo "Y" || echo "N"
Y

$ VAR=25A
$ [ $VAR == "25A" ] && echo "Y" || echo "N"
Y