if then else; no varible match but statement executes anyway.

view story

http://www.unix.com – My first then statement is executing even though there is no match between the variables. each subsequent if then statement is also executing. Why do they execute when there is no match in the dates? Code: yr=`date +%y` date1=12-31-$yr date=`date +%m-%d-%y` set -vx if  [ "$date" == "$date1" ] ;         then                 #rm /root/sar_data/hist_sar*-*-2012.tar.gz                 printf "2012\n" fi         if [ "$date&quot (HowTos)