title: csh inline if statements
body: <p>I'm trying to add a script to check conditions before executing a command in my <code>.cshrc</code> file. This checker script returns 0 if the conditions are insufficient, and 1 otherwise. (I realize this is backwards of convention, but I thought it would be easier for if statements.)</p>
  
  <p>Here is what I've tried, replacing the command with <code>echo "ok"</code>:</p>
  
  <pre><code>./checker.sh &amp;&amp; echo "ok"
  </code></pre>
  
  <p>Echoes "ok" even though <code>checker.sh</code> returns 0.</p>
  
  <pre><code>test ./checker.sh &amp;&amp; echo "ok"
  </code></pre>
  
  <p>Echoes "ok" even though <code>checker.sh</code> returns 0, but also suppresses error messages in <code>checker.sh</code>.</p>
  
  <pre><code>if ( ./checker.sh ) then echo "ok" endif
  </code></pre>
  
  <p>Throws an if-statement syntax error.</p>
  
  <p>I want to turn this into an alias, hence the one-line constraint, e.g.</p>
  
  <pre><code>alias doAction './checker.sh &amp;&amp; echo "ok"'
  </code></pre>
  
  <p>How does one accomplish this with <code>(t)csh</code> without directly calling the command in the checker script?</p>
  
  <p>Thanks!</p>