csh and globbing in `..`

enag at ifi.uio.no enag at ifi.uio.no
Sun Mar 13 23:02:50 AEST 1988


Shankar Unni <shankar at hpclscu.HP.COM> has a problem with file globbing
within ``.  Actually, the problem is not within ``.  It is the order In
which the the command line is interpreted that is your problem.  In
csh, the `` is obviously parsed and executed before file names are
globbed.  Thus there is no difference between

	echo * foo bar
and	echo `grep foo zot`

if "grep foo zot" says "* foo bar".

There should, therefore, be no difference between

	echo "* foo bar"
and	echo "`grep foo zot`"

either, given the above match for foo.

I think this has solved your problem, Shankar, unless, of course, you
want "line" after

	set line = "`grep Compile RESULTS`"

to be a list of three elements, instead of one element with embedded
spaces, which is what this will give you.

By the way, the csh I occasionally use here at the University of Oslo
SunOS 3.4EXPORT installation does behave correctly (or, as you want it
to) when I set noglob.  (I did not find any version information in
/bin/csh.  It might have come with SunOS 3.2 or 3.3.)

Erik Naggum
ARPA:	enag at ifi.uio.no (or erik%naggum.uucp at ifi.uio.no)
UUCP:	erik at naggum.se	(or ...!uunet!naggum!erik)
FONE:	+47-2-384-800 (work), +47-2-549-163 (home)
MAIL:	Naggum Software, POB 1560 VIKA, 0118 OSLO, NO(R)WAY



More information about the Comp.unix.wizards mailing list