Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Jun 2002 00:50:03 -0700 (PDT)
From:      Peter Pentchev <roam@ringlet.net>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/39198: sh aborts on variables with periods
Message-ID:  <200206140750.g5E7o3A03840@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: Peter Pentchev <roam@ringlet.net>
To: Joe Kelsey <joek@mail.flyingcroc.net>
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200206140750.g5E7o3A03840>