title: switch/case doesn't work in awk
body: <p>I am writing a simple awk in redhat linux,but found switch/case doesn't work for me. I searched on web, but didn't find a solution. The following is my code:</p>
  
  <pre><code> BEGIN {
     foo = 1;
       switch (foo) {
           case 3:
           print "x";
           break;
           case 2:
           print "y" ;
           break;
           case 1:
           print "z" ;
           break;
           default:
           print "default" ;
        }
   }
  </code></pre>
  
  <p>the awk I am running is GNU Awk 3.1.5. I got the following err:</p>
  
  <blockquote>
    <p>awk -f test.awk</p>
  </blockquote>
  
  <pre><code>awk: test.awk:3:      switch (foo) {
  awk: test.awk:3:                   ^ syntax error
  awk: test.awk:5:          case 3:
  awk: test.awk:5:                ^ syntax error
  awk: test.awk:8:          case 2:
  awk: test.awk:8:                ^ syntax error
  awk: test.awk:11:          case 1:
  awk: test.awk:11:                ^ syntax error
  awk: test.awk:14:          default:
  awk: test.awk:14:                 ^ syntax error
  </code></pre>
  
  <p>can anybody please help me out? thank you!</p>