Newsgroups: comp.unix.shell
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!batcomputer!theory.tn.cornell.edu!christos
From: christos@theory.tn.cornell.edu (Christos S. Zoulas)
Subject: Re: Csh setenv and `` don't like each other!
Message-ID: <1991Apr23.210431.14489@batcomputer.tn.cornell.edu>
Keywords: csh
Sender: news@batcomputer.tn.cornell.edu
Nntp-Posting-Host: theory.tn.cornell.edu
Organization: Electrical Engineering, Cornell University, Ithaca NY
References: <11744@jarthur.Claremont.EDU> <1991Apr23.004314.17527@athena.mit.edu> <1991Apr23.154211.8976@usenet.ins.cwru.edu>
Distribution: usa
Date: Tue, 23 Apr 1991 21:04:31 GMT

In article <1991Apr23.154211.8976@usenet.ins.cwru.edu> chet@po.CWRU.Edu writes:

>It was Chris Torek.  Perhaps if you asked very nicely, he would explain it
>again ;-)

Since I'll fixed it for tcsh, I'll try to explain... (Though my explanation
is not going to be as good as Chris Torek's)

Csh in many places, is using a routine called globone() to expand regular
expressions. This routine will produce an error if the regular expression
expands to more (or less than) one word.

If the regular expression expands to more than one word, then globone()
will complain 'blah: Ambiguous.'; if it expands to less than one word it
will say 'blah: No match.'. (blah is the offending regular expression)

Unfortunately this routine is used in many places in csh, and here's a
list of some of the most annoying ones:

% kill `echo 1 2 3`	
% `echo date -u`	
% setenv FOO `echo 1 2 3` 
% echo foo > `echo 1 2 3`

In some cases you can quote the regular expression to achieve the desired
result (example 3, maybe 4). In cases 1 and 2 though it is the csh code
that needs fixing...

christos
-- 
Christos Zoulas         | 389 Theory Center, Electrical Engineering,
christos@ee.cornell.edu | Cornell University, Ithaca NY 14853.
christos@crnlee.bitnet  | Phone: (607) 255 0302, Fax: (607) 255 9072
