Csh setenv and `` don't like each other!

Christos S. Zoulas christos at theory.tn.cornell.edu
Wed Apr 24 07:04:31 AEST 1991


In article <1991Apr23.154211.8976 at usenet.ins.cwru.edu> chet at 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 at ee.cornell.edu | Cornell University, Ithaca NY 14853.
christos at crnlee.bitnet  | Phone: (607) 255 0302, Fax: (607) 255 9072



More information about the Comp.unix.shell mailing list