Are you running the script independently using "sh script_name" ? It won't work as [[ is a bash-bulletin
So instead run it as ./script_name it will decide its interpreter itself in first line.
http://stackoverflow.com/questions/12230690/string-comparison-in-bash-not-found