NetBSD Problem Report #268

From gnats  Sun May 29 20:50:09 1994
Received: (from jtc@localhost) by sun-lamp.cs.berkeley.edu (8.6.9/8.6.9) id UAA17634; Sun, 29 May 1994 20:50:09 -0700
Message-Id: <[email protected]>
Date: Sun, 29 May 1994 20:50:09 -0700
From: "J.T. Conklin" <jtc>
Reply-To: [email protected]
To: [email protected]
Subject: shell case statements are parsed incorrectly
X-Send-Pr-Version: 3.2

>Number:         268
>Category:       bin
>Synopsis:       shell case statements are parsed incorrectly
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun May 29 21:05:03 +0000 1994
>Closed-Date:    Wed Jun 08 12:35:10 +0000 1994
>Last-Modified:  
>Originator:     J.T. Conklin
>Release:        NetBSD-current
>Organization:
Winning Strategies, Inc.
>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:

>Release-Note:
>Audit-Trail:

State-Changed-From-To: open->feedback
State-Changed-By: jtc
State-Changed-When: Thu Jun  2 22:09:48 1994
State-Changed-Why:
I checked in new code to parse case statements --- it seems to work,
but since the code is pretty obscure and I could have easily made a
mistake, I'll leave this open a little longer.

State-Changed-From-To: feedback->closed
State-Changed-By: jtc
State-Changed-When: Wed Jun  8 12:35:10 1994
State-Changed-Why:
Good thing I waited, there was a bug.  But it's now been fixed and the 
code has been made availiable for about a week, so it looks like it's 
safe to close this bug.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.