Subject: bin/268: shell case statements are parsed incorrectly
To: None <gnats-admin>
From: J.T. Conklin <jtc>
List: netbsd-bugs
Date: 05/29/1994 21:05:05
>Number:         268
>Category:       bin
>Synopsis:       shell case statements are parsed incorrectly
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun May 29 21:05:03 1994
>Originator:     J.T. Conklin
>Organization:
Winning Strategies, Inc.
>Release:        NetBSD-current
>Environment:
	
System: NetBSD sun-lamp.cs.berkeley.edu 0.9B SUN_LAMP#91 i386


>Description:

The shell does not accept shell keywords as part (or all) of the
patterns in case statements.  It has always had this problem, but it
was just discovered recently with perl's Configure script because !
has become a shell keyword (because of POSIX.2).

>How-To-Repeat:
Source (use the `.' command) the following script:

case "$fastread" in
yes) ans=''; echo " " ;;
*) ans='!';;
esac
while expr "X$ans" : "X!" >/dev/null; do
    read ans
    case "$ans" in
    !)
        sh
        echo " "
        echo -n "$rp "
        ;;
    !*)
        set `expr "X$ans" : "X!\(.*\)$"`
        sh -c "$*"
        echo " "
        echo -n "$rp "
        ;;
    esac
done
rp='Your answer:'
case "$ans" in
'') ans="$dflt";;
esac

>Fix:

>Audit-Trail:
>Unformatted:


------------------------------------------------------------------------------