title: How to write elif command in shell script like elseif or else command in fortran
body: <p>I am facing problem using elif command in shell script like I do in fortran. </p>
  
  <p>I have the employee lists of 100 companies. I want to mask out those companies having less than 500 employees. My script is </p>
  
  <pre><code>rm -f category_1.txt category_2.txt
  var=company
  for j in 1..100
  do n=$(wc -l &lt; $var_$j.txt)
  if [ n -ge 500 ]; then 
  echo $var_$j &gt;&gt; category_1.txt
  elif       #I know it will not work
  echo $var_$j &gt;&gt; category_2.txt
  fi
  done
  </code></pre>
  
  <p>I know, I should write "elif [ n -lt 500 ]; then". But I want to be clear whether "elif" can be used like fortran? In case of fortran, we just write</p>
  
  <pre><code>if (n .ge. 500) then
  write (1, *) company(j)
  else
  write (2,*) company(j)
  endif
  </code></pre>