title: single-line if statement in a shell script not working
body: <p>This is my code:</p>
  
  <pre><code>#!/bin/bash
  cat input$1 | ./prog$1 &gt; output$1 &amp;&amp; if[ "$2" != "" ]; diff output$1 expected$1;
  </code></pre>
  
  <p>This then happens:</p>
  
  <pre><code>$ ./run.sh
  ./run.sh: line 2: if[ no !=  ]: command not found
  $
  </code></pre>
  
  <p>I thought that I could run if statements on one line? is that what the problem is? </p>