title: One line if statement in bash
body: <p>I've never programed in bash... yet I'm trying to solve a problem for an anchievement in a game (codingame.com)</p>
  
  <p>I have the following code:</p>
  
  <pre><code>for (( i=0; i&lt;N-1; i++ )); do
     tmp=$(( sorted_array[i+1] - sorted_array[i] ));
     if [ $tmp &lt; $result ]; then result=$tmp fi
  done
  </code></pre>
  
  <p>And this error:</p>
  
  <pre><code>/tmp/Answer.sh: line 42: syntax error near unexpected token `done'at Answer.sh. on line 42
  /tmp/Answer.sh: line 42: `done' at Answer.sh. on line 42
  </code></pre>
  
  <p>I want to compare adjacent values of my array and store the minimun diference between them... but I cant figure how to do an If statement in bash</p>