Date: Sun, 2 Jun 1996 12:15:02 +0200 From: filip.bovyn@ping.be (Filip Bovyn) To: FreeBSD-gnats-submit@freebsd.org Subject: bin/1287: /bin/sh does alias expansion in case patterns Message-ID: <199606021015.MAA05940@hal9000.not4u.net> Resent-Message-ID: <199606021020.DAA13454@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199606021015.MAA05940>