[wellylug] How do get Switch working in bash (Debian)

Sigurd Magnusson sigurd at silverstripe.com
Wed May 9 09:07:45 NZST 2007


Why does the following complain with
 ./switchtest: line 5: syntax error near unexpected token `$colour'
 ./switchtest: line 5: `switch ($colour)'
 
 -------------------------
 #!/bin/bash
 
 colour=2
 
 switch ($colour)
 case "red":
 echo "ruddy";
 breaksw
 
 case "green":
 echo "ecological";
 breaksw
 
 default:
 echo "odd";
 
 endsw
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wellylug.org.nz/pipermail/wellylug/attachments/20070509/abacd0f5/attachment.htm 


More information about the wellylug mailing list