OT: case statements in sh
Jay R. Ashworth
jra at baylink.com
Tue Jan 24 19:15:18 PST 2006
On Tue, Jan 24, 2006 at 09:50:00PM -0500, Kenneth Brody wrote:
> My copy of bash 1.14.7(1) won't allow the above syntax. It requires ";;"
> between each case.
>
> ==========
> case "$1" in
> 1) echo one
> 2) echo two
> 3) echo three
> *) echo default
> esac
> ==========
> /tmp/foo.sh: syntax error near unexpected token `2)'
> /tmp/foo.sh: /tmp/foo.sh: line 3: ` 2) echo two'
> ==========
I'm wrong; you win; shut up. ;-)
Apparently you cannot implement Duff's Device in bash, which is kind of
ironic, since in my googling, I discovered that apparently *bash* uses
it, internally.
Cheers,
-- jra
--
Jay R. Ashworth jra at baylink.com
Designer Baylink RFC 2100
Ashworth & Associates The Things I Think '87 e24
St Petersburg FL USA http://baylink.pitas.com +1 727 647 1274
A: No.
Q: Should I include quotations after my message body?
More information about the Filepro-list
mailing list