Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Mar 1996 11:46:06 +0100
From:      se@zpr.uni-koeln.de (Stefan Esser)
To:        tege@noisy.matematik.su.se
Cc:        bugs@freebsd.org
Subject:   Re: bin/1052: /bin/sh problem with new GCC (snapshot for 2.8)
Message-ID:  <199603011046.AA19051@Sysiphos>
In-Reply-To: tege@matematik.su.se "bin/1052: /bin/sh problem with new GCC (snapshot for 2.8)" (Feb 29, 23:27)

next in thread | raw e-mail | index | archive | help
On Feb 29, 23:27, tege@matematik.su.se wrote:
} Subject: bin/1052: /bin/sh problem with new GCC (snapshot for 2.8)
} 
} >Number:         1052
} >Category:       bin
} >Synopsis:       /bin/sh problem with new GCC (snapshot for 2.8)
} >Confidential:   no
} >Severity:       serious
} >Priority:       low
} >Responsible:    freebsd-bugs
} >State:          open
} >Class:          sw-bug
} >Submitter-Id:   current-users
} >Arrival-Date:   Thu Feb 29 14:40:03 PST 1996
} >Last-Modified:
} >Originator:     Torbjorn Granlund
} >Organization:
} TMG Datakonsult
} >Release:        FreeBSD 2.1-STABLE i386
} >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.


How about:

sh$ foo=tomte; var=foo; echo `eval echo \$"$var"`

(Tested under BASH, too ...)

Regards, STefan
-- 
 Stefan Esser, Zentrum fuer Paralleles Rechnen		Tel:	+49 221 4706021
 Universitaet zu Koeln, Weyertal 80, 50931 Koeln	FAX:	+49 221 4705160
 ==============================================================================
 http://www.zpr.uni-koeln.de/~se			  <se@ZPR.Uni-Koeln.DE>



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