From owner-freebsd-bugs Fri Jun 14 0:50:13 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 2404C37B43A for ; Fri, 14 Jun 2002 00:50:03 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g5E7o3A03840; Fri, 14 Jun 2002 00:50:03 -0700 (PDT) (envelope-from gnats) Date: Fri, 14 Jun 2002 00:50:03 -0700 (PDT) Message-Id: <200206140750.g5E7o3A03840@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Peter Pentchev Subject: Re: bin/39198: sh aborts on variables with periods Reply-To: Peter Pentchev 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: Peter Pentchev To: Joe Kelsey Cc: bug-followup@FreeBSD.org Subject: Re: bin/39198: sh aborts on variables with periods Date: Fri, 14 Jun 2002 10:47:09 +0300 On Wed, Jun 12, 2002 at 11:24:01AM -0700, Joe Kelsey wrote: > Peter Pentchev wrote: > > >On Wed, Jun 12, 2002 at 06:08:27PM -0000, Joe Kelsey wrote: > >>> > >> /bin/sh does not gracefully accept variables with periods. > > > >Does ksh93 set $SHELL to 'sh' and, for login shells, '-sh', or does it > >(as it should, IMHO) set it to 'ksh' and '-ksh', respectively? > > > > > ksh sets it to /bin/ksh. Well, /bin/sh doesn't :) [snip] > If there was a reliable way to detect /bin/sh I could use that instead > of trying to detect ksh. You mean, like, testing $SHELL for being "/bin/ksh"? :) if [ "$SHELL" = "/bin/ksh" ]; then ksh-specific code else plain ol' Bourne shell fi ..or maybe even.. if expr "$SHELL" : '.*ksh$'; then ksh-specific code else plain ol' Bourne shell fi ..which would match 'ksh', '-ksh', '/bin/ksh', '/usr/local/bin/ksh', and other variations. HTH. G'luck, Peter -- Peter Pentchev roam@ringlet.net roam@FreeBSD.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 Do you think anybody has ever had *precisely this thought* before? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message