From tege@noisy.matematik.su.se  Thu Feb 29 14:32:15 1996
Received: from noisy.matematik.su.se ([130.237.198.146])
          by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id OAA14876
          for <FreeBSD-gnats-submit@freebsd.org>; Thu, 29 Feb 1996 14:30:03 -0800 (PST)
Received: (from tege@localhost) by noisy.matematik.su.se (8.6.12/8.6.12) id XAA05612; Thu, 29 Feb 1996 23:27:57 +0100
Message-Id: <199602292227.XAA05612@noisy.matematik.su.se>
Date: Thu, 29 Feb 1996 23:27:57 +0100
From: tege@matematik.su.se
Reply-To: tege@noisy.matematik.su.se
To: FreeBSD-gnats-submit@freebsd.org
Subject: /bin/sh problem with new GCC (snapshot for 2.8)
X-Send-Pr-Version: 3.2

>Number:         1052
>Category:       bin
>Synopsis:       /bin/sh problem with new GCC (snapshot for 2.8)
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    joerg
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 29 14:40:03 PST 1996
>Closed-Date:    Sun Sep 1 05:39:23 PDT 1996
>Last-Modified:  Sun Sep  1 05:41:30 PDT 1996
>Originator:     Torbjorn Granlund
>Release:        FreeBSD 2.1-STABLE i386
>Organization:
TMG Datakonsult
>Environment:
Hardly relevant.

>Description:

The /bin/sh of FreeBSD doesn't work as on other systems, or like bash.
The problem seems to be with the builtin `eval'.

>How-To-Repeat:

bash$ foo=tomte; var=foo; echo `eval echo \\$$var`
tomte
sh$ foo=tomte; var=foo; echo `eval echo \\$$var`
5578var

>Fix:
	
I don't know of any fix that is compatible with a non-flawed sh.  A fix
would be desirable if you want your users that install GCC 2.8 to avoid
problems.  Just imagine the flood of bug reports that you will get...

If you provide me with a (reasonable) fix, I will put it in to the gcc
repository in time for 2.8.
>Release-Note:
>Audit-Trail:

From: Bruce Evans <bde@zeta.org.au>
To: FreeBSD-gnats-submit@FreeBSD.ORG, tege@matematik.su.se
Cc:  Subject: Re: bin/1052: /bin/sh problem with new GCC (snapshot for 2.8)
Date: Fri, 1 Mar 1996 21:29:09 +1100

 >The /bin/sh of FreeBSD doesn't work as on other systems, or like bash.
 >The problem seems to be with the builtin `eval'.
 
 >>How-To-Repeat:
 
 >bash$ foo=tomte; var=foo; echo `eval echo \\$$var`
 >tomte
 >sh$ foo=tomte; var=foo; echo `eval echo \\$$var`
 >5578var
 
 This is fixed in the following versions of ash:
 
 	the one in FreeBSD-1.1.5
 	the original one + assorted fixes from various places
 	the one in BSD-4.4lite2
 
 Bruce
Responsible-Changed-From-To: freebsd-bugs->joerg 
Responsible-Changed-By: joerg 
Responsible-Changed-When: Fri Apr 12 23:36:24 MET DST 1996 
Responsible-Changed-Why:  
I'm goinmg to deal with sh(1) bugs some day. 
State-Changed-From-To: open->closed 
State-Changed-By: peter 
State-Changed-When: Sun Sep 1 05:39:23 PDT 1996 
State-Changed-Why:  
Fixed after 4.4Lite2 merge 
>Unformatted:

