From owner-freebsd-bugs Wed Jun 12 12:50:10 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 7A8A637B407 for ; Wed, 12 Jun 2002 12:50:03 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g5CJo3603336; Wed, 12 Jun 2002 12:50:03 -0700 (PDT) (envelope-from gnats) Date: Wed, 12 Jun 2002 12:50:03 -0700 (PDT) Message-Id: <200206121950.g5CJo3603336@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Matthias Buelow Subject: Re: bin/39198: sh aborts on variables with periods Reply-To: Matthias Buelow Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/39198; it has been noted by GNATS. From: Matthias Buelow To: Joe Kelsey Cc: FreeBSD-gnats-submit@FreeBSD.org Subject: Re: bin/39198: sh aborts on variables with periods Date: Wed, 12 Jun 2002 21:40:49 +0200 Joe Kelsey wrote: > /bin/sh does not gracefully accept variables with periods. Neither does ksh88, the direct predecessor to ksh93, which is used as "sh" and "ksh" on most Unix systems, so you have to modify your startup script in any case. It answers with almost exactly the same message as fbsd /bin/sh. > Either /bin/sh has to allow parameters to contain periods or it > has to provide a reliable method of detecting /bin/sh versus > ksh. Try to check for RANDOM, which does not exist on sh. It probably exists on bash (haven't checked) but you can check that through the existance of BASH_VERSION. Similarly probably for zsh. Then try to check for KSH_VERSION to draw the line between ksh and pdksh. Then you might do a strings ${0##-}|grep "@(#)Version" (or use what(1)) and check for "M 1993" which is a bit wasteful but if you really want to know then that'll work. Then you probably want to differentiate further since some earlier version of the '93 edition did not support everything that is described in the Kornshell book (if you're really pedantic.) --mkb To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message