From owner-freebsd-bugs Sun Jun 2 03:20:03 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id DAA13460 for bugs-outgoing; Sun, 2 Jun 1996 03:20:03 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id DAA13454; Sun, 2 Jun 1996 03:20:01 -0700 (PDT) Resent-Date: Sun, 2 Jun 1996 03:20:01 -0700 (PDT) Resent-Message-Id: <199606021020.DAA13454@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, filip.bovyn@ping.be Received: from hal9000.not4u.net (dialup16.kortrijk.eunet.be [193.74.5.16]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id DAA13145 for ; Sun, 2 Jun 1996 03:13:05 -0700 (PDT) Received: (from root@localhost) by hal9000.not4u.net (8.6.12/8.6.12) id MAA05940; Sun, 2 Jun 1996 12:15:02 +0200 Message-Id: <199606021015.MAA05940@hal9000.not4u.net> Date: Sun, 2 Jun 1996 12:15:02 +0200 From: filip.bovyn@ping.be (Filip Bovyn) Reply-To: filip.bovyn@ping.be To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/1287: /bin/sh does alias expansion in case patterns Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >Number: 1287 >Category: bin >Synopsis: /bin/sh does alias expansion in case patterns >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Jun 2 03:20:01 PDT 1996 >Last-Modified: >Originator: Filip Bovyn >Organization: >Release: FreeBSD 2.1-STABLE i386 >Environment: FreeBSD 2.1-RELEASE >Description: When I execute the following script with /bin/sh --------------------------- #!/bin/sh alias l='ls -l' val=lucid case "${val}" in l|lucid) echo "lucid" ;; esac ---------------------------- I get the error: /home/filip/testsh: 6: Syntax error: word unexpected (expecting ")") Apparently, the 'l' in the case pattern is expanded to "ls -l". This is not what one might expect. >How-To-Repeat: See under 'Description'. >Fix: Use pdksh, zsh, or bash instead >Audit-Trail: >Unformatted: