🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.bash.bug
Article #155

Re: evaluation order wrong?

#155
From: Chet Ramey
Date: Tue, 27 Jun 1989 17:05
29 lines
1357 bytes
In article <8906270547.AA01124@hobbes.ai.mit.edu> roland@AI.MIT.EDU (Roland McGrath) writes:
>The evaluation order of ~ vs $ is not like csh's.  Maybe this is wrong?

Bash is not csh.

All the Bourne-style shells (basically shells that do Bourne-style single
quote evaluation) that I have access to that do tilde expansion (bash, ksh,
a hacked s5r2 /bin/sh) are consistent.  Bash does it right, if sh compatibility
is the goal.

If you want the csh-style results, assigning to foo without the quotes seems
to work.  A weirder way to get what you want is this:

pirate$ foo='~/bin'
pirate$ echo $foo
~/bin
pirate$ foo=$(eval echo $foo)
pirate$ echo $foo
/usr/homes/chet/bin


Chet



Chet Ramey     Network Services Group, CWRU    chet@cwjcc.INS.CWRU.Edu

"The flagon with the dragon has the potion with the poison;
	the vessel with the pestle holds the brew that is true!"
Technical Details
Message-ID: <379@cwjcc.CWRU.Edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!ukma!cwjcc!kiwi!chet
References: <8906270547.AA01124@hobbes.ai.mit.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!ukma!cwjcc!kiwi!chet
From: chet@kiwi.CWRU.EDU (Chet Ramey)
Newsgroups: gnu.bash.bug
Subject: Re: evaluation order wrong?
Message-ID: <379@cwjcc.CWRU.Edu>
Date: 27 Jun 89 17:05:45 GMT
References: <8906270547.AA01124@hobbes.ai.mit.edu>
Sender: news@cwjcc.CWRU.Edu
Reply-To: chet@kiwi.INS.CWRU.Edu (Chet Ramey)
Distribution: gnu
Organization: CWRU Andrew R. Jennings Computing Center
Lines: 29