title: tcsh if/then statement gives error
body: <p>I'm trying to do a simple tcsh script to look for a folder, then navigate to it if it exists. The statement evaluates properly, but if it evaluates false, I get an error "then: then/endif not found". If it evaluates true, no problem. Where am I going wrong?</p>
  
  <pre><code>#!/bin/tcsh
  set icmanagedir = ""
  set workspace = `find -maxdepth 1 -name "*$user*" | sort -r | head -n1`
  if ($icmanagedir != "" &amp;&amp; $workspace != "") then
    setenv WORKSPACE_DIR `readlink -f $workspace`
    echo "Navigating to workspace" $WORKSPACE_DIR
    cd $WORKSPACE_DIR
  endif
  </code></pre>
  
  <p>($icmanagedir is initialized elswehere, but I get the error regardless of which variable is empty)</p>