*BSD News Article 91288


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!dispatch.news.demon.net!demon!news.maxwell.syr.edu!news.mathworks.com!fu-berlin.de!irz401!orion.sax.de!uriah.heep!news
From: j@uriah.heep.sax.de (J Wunsch)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: A simple csh script question
Date: 17 Mar 1997 22:39:24 GMT
Organization: Private BSD site, Dresden
Message-ID: <5gkh6s$a3@uriah.heep.sax.de>
References: <332D9485.27FD@injapan.net>
Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch)
NNTP-Posting-Host: localhost.heep.sax.de
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Newsreader: knews 0.9.6
X-Phone: +49-351-2012 669
X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F  93 21 E0 7D F9 12 D6 4E
Lines: 24
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:37221

Doug Lerner <doug@inJapan.net> wrote:

> Can somebody answer a simple csh script question for me? In the

Well, it's actually a (Posix) sh script. ;-)

> following script, the last line won't work unless I add "eval" to the
> front of the line. Without eval, the "~" mark does not cause the
> expansion to the user's home directory, like it usually does. Why might
> that be?

> eval ls ~$id | grep forward

Probably because $id doesn't constitute a word for the shell, but
tilde expansion is defined for words only.  By passing it to eval, the
$id expansion will be done first, so the subshell eval'ing the result
sees a word again.

-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)