Date: 12 Jun 2002 18:08:27 -0000 From: Joe Kelsey <joek@mail.flyingcroc.net> To: FreeBSD-gnats-submit@FreeBSD.org Subject: bin/39198: sh aborts on variables with periods Message-ID: <20020612180827.82491.qmail@unx48.staff.flyingcroc.net>
next in thread | raw e-mail | index | archive | help
>Number: 39198 >Category: bin >Synopsis: sh aborts on variables with periods >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jun 12 11:10:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Joe Kelsey >Release: FreeBSD 4.6-RC i386 >Organization: >Environment: System: FreeBSD unx48.staff.flyingcroc.net 4.6-RC FreeBSD 4.6-RC #11: Wed Jun 12 08:37:42 PDT 2002 joek@unx48.staff.flyingcroc.net:/usr/obj/usr/src/sys/UNX48 i386 >Description: /bin/sh does not gracefully accept variables with periods. ksh93 has a new feature of structured variables. These are variables that behave like C structures. Along with this new feature, where sub-variables are separated by periods, ksh also allows variables to begin with periods. This causes a problem in compatibility. If your login shell is ksh93, and you set ENV=~/.ksh93, then when you su, /bin/sh will try to process your ENV file and issue the error message: Syntax error: Bad substitution. when it tries to process the following line: if [ -n "$KSH_VERSION"] || [ -n "${.sh.version}" ] then # ksh-only stuff fi Either /bin/sh has to allow parameters to contain periods or it has to provide a reliable method of detecting /bin/sh versus ksh. >How-To-Repeat: See above >Fix: Change the is_name and is_in_name macros to allow periods in addition to underscores. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020612180827.82491.qmail>