bug in csh "@" command
utzoo!decvax!microsof!fluke!jeff
utzoo!decvax!microsof!fluke!jeff
Tue Mar 29 18:49:12 AEST 1983
The csh statements
set tt = 0
set t1 = 0
@ tt = 0
are processed properly and do the expected thing.
However, the statement
@ t1 = 0
fails with the message "@: Syntax error.".
The problem occurs because the @ command disallows variable names containing
integers. I can't concoct a good justification for this - it looks like a
simple oversight to me. At any rate, it disagrees with the documentation.
The @ command is processed by the routine dolet() in file sh.set.c.
A quick inspection shows that variable names are parsed by the statements
for (vp = p; letter(*p); p++)
continue;
if (vp == p)
goto letsyn;
I believe that this should be changed to
for (vp = p; alnum(*p); p++)
continue; /* step over the variable name */
if (vp == p || !letter(*vp))
goto letsyn; /* the name must be non-null and begin
with a letter */
Jeff Stearns ...!decvax!microsoft!fluke!jeff
John Fluke Mfg. Co., Everett WA. (206) 356-5064
BTW, here's one that *is* accepted:
set 1 = 2
The set statement is processed by the function doset() in sh.set.c; analogous
changes to that function would correct this anomaly as well.
More information about the Comp.bugs.4bsd.ucb-fixes
mailing list