title: What is the reason for the weird syntax of the "case" statement in a bash/zsh script?
body: <p>Looking from a programmer's point of view then shell script is just another programming language, where one has to learn and conform to the rules of the language. However, I have to admit that this syntax is the weirdest style I have ever seen in a rather commonly used language. Did the shell take this syntax from an older language that it descents from? Is there a special implication / meaning in the syntax?</p>
  
  <p>As an example, here is a little snippet that I take from <a href="https://stackoverflow.com/questions/3989656/init-d-celery-script-for-centos/4046542#4046542">another post</a> on SO</p>
  
  <pre><code>case "$1" in
      start)
          start
          ;;
      stop)
          stop
          ;;
      restart)
          stop
          start
          ;;
      status)
          check_status
          ;;
      *)
          echo "Usage: $0 {start|stop|restart|status}"
          exit 1
          ;;
  esac
  </code></pre>
  
  <p>Looking at this, firstly I can see that <code>case</code> ends with <code>esac</code>, which is its reversed form (like <code>if</code> ending in <code>fi</code>). Secondly I understand that each case is followed by a <code>)</code>. Fair enough, but why on earth do I need two <code>;</code> at the end of each statement? I would also say that the <code>)</code> without an accompanying <code>(</code> is ugly.</p>
  
  <p>I'm looking for more information about the historical aspect of the language, but I'm open for technical reasons as well.</p>