Date: Wed, 12 Jun 2002 13:10:03 -0700 (PDT) From: Joe Kelsey <joek@mail.flyingcroc.net> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/39198: sh aborts on variables with periods Message-ID: <200206122010.g5CKA3L09165@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/39198; it has been noted by GNATS.
From: Joe Kelsey <joek@mail.flyingcroc.net>
To: Matthias Buelow <mkb@informatik.uni-wuerzburg.de>
Cc: Joe Kelsey <joek@mail.flyingcroc.net>,
FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: bin/39198: sh aborts on variables with periods
Date: Wed, 12 Jun 2002 13:05:24 -0700
Matthias Buelow wrote:
> 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.)
>
Thanks for the suggestions. So far I am not concerned about bash or
zsh, but I will keep it in mind. I just want to separate generic ksh
from /bin/sh, and RANDOM should do that. The check for KSH_VERSION
fails in ksh93 since they went to the .sh.version parameter and dropped
KSH_VERSION completely, a real killer.
/Joe
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?200206122010.g5CKA3L09165>
