Looks like your script is written for C style shells. linux uses bash (a borne style shell) by default, which uses different syntax.
You could install tcsh, and then have the first lilne of your script as:
However, consider not using c shells - they're horrible to code in. Learn the borne style shell syntax - you'll never look back.