The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 05-19-2006
Vikas Sood Vikas Sood is offline
Registered User
 

Join Date: May 2006
Posts: 32
may be i was not clear

excuse me if i did not clearly stated the prob. Consider this piece of code:

if( $3 == "R001" )
print "xxx";
else
print "yyy";
fi

my question is why can't I use the following instead of above:

if [[ $3 = "R001" ]]
print "xxx"
else
print "yyy"
fi

Also, is there is a difference in () and [[ ]] in above two examples?

Thanks
Reply With Quote