Subject: case bug in /bin/sh
To: None <current-users@sun-lamp.cs.berkeley.edu>
From: David Carrel <carrel@cisco.com>
List: current-users
Date: 06/02/1994 22:55:34
I have a problem with the current version of /bin/sh. I supped on 1 June,
and now my sh doesn't handle case statements with OR's ("|") in it. The
following script:
#!/bin/sh
case $1 in
foo|foor)
# this is a test
echo user didnt type foo
;;
esac
will fail with the following:
/tmp/foo: 3: Syntax error: word unexpected (expecting ")")
I played around with this for a bit and it seems that the determining
factor is the OR "|" inside the case statement.
This causes g++ and nroff to break, so I noticed real fast.
Dave
----------------------------------------------------------------------------
David Carrel | E-mail: carrel@cisco.com
Security Development, cisco Systems | phone: (415) 324-5207
P.O. Box 3075, 1525 O'Brien Dr. | fax: (415) 428-5080
Menlo Park, Ca, 94025-1435 |
----------------------------------------------------------------------------
------------------------------------------------------------------------------