title: linux if / elif / fi command
body: <p>I have a question.  If my <code>if</code> statement is <code>true</code>, does it skip the <code>elif</code> check and goes straight to <code>fi</code> or does it still check the <code>elif</code> statements?  </p>
  
  <p>Example of the script :</p>
  
  <pre><code>if [ argument1 || argument2 ]  
       then  
            do something.  
  elif [ argument2 || argument3 ]  
       then  
            do something.  
  elif [ argument2 || argument4 ]  
       then  
            do somthing.  
  else  
            do somthing else.  
  fi  
  </code></pre>
  
  <p>My question being that I would want my <code>elif</code> statements to still be checked if my first <code>if</code> statement was true.  I would also want my <code>elif</code> statements to be checked if my first <code>elif</code> statement was <code>true</code>... etc.  Basically I would want all my <code>if</code> and <code>elif</code> statements to all be checked.  </p>
  
  <p>NB. I realize I could change all of my <code>elif</code> to <code>if</code> statements and this would probably resolve my issue since all <code>if</code> statements would get checked.  But this question is also out of curiosity and better knowledge of the <code>if</code> and <code>elif</code> statements.</p>
  
  <p>Please let me know if you need more info.</p>