title: If Else not working when used #!/bin/sh shebang in UNIX
body: <p>I am using AIX 6.1. Below code is working fine for me.</p>
  
  <pre><code>if [ "$HOSTNAME" = "host1" ]; then
    echo "This is host1"
  elif [ "$HOSTNAME" = "host2" ]; then
    echo "This is host2"
  else
    echo "This is another host"
  fi
  </code></pre>
  
  <p>But when I use Shebang in my code, always the last else part is getting executed even if the first/second if conditions are true.</p>
  
  <pre><code>#!/bin/sh
  if [ "$HOSTNAME" = "host1" ]; then
    echo "This is host1"
  elif [ "$HOSTNAME" = "host2" ]; then
    echo "This is host2"
  else
    echo "This is another host"
  fi
  </code></pre>
  
  <p>How can I get the same output as in first code snippet but with using shebang.</p>
  
  <p>P.S. : I can't write the script without using shebang due to some constraints.</p>