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

Jim Cheetham jim at gonzul.net
Wed May 9 09:10:28 NZST 2007


On 09/05/07, Sigurd Magnusson <sigurd at silverstripe.com> wrote:
>  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
>

Because "switch" isn't part of bash.
IIRC it's part of csh.

-jim




More information about the wellylug mailing list