More csh bugs
Michael "Ford" Ditto
ditto at cbmvax.UUCP
Wed Feb 1 10:56:25 AEST 1989
Here's a long-standing csh bug that some people might not know about ...
It happens when a variable whose name ends in a digit is referenced with
${}.
% echo ${foo1} # should generate 'Undefined variable'
Variable syntax. # gets this instead
% history 2 # look at the history
1 echo 1${foo} # what???
2 history 2
%
Here's one I just discovered ... It seems that when 'alias' is run with
no args, the alias names are printf-expanded with random arguments.
% alias k% 'kill %' # set up an alias
% alias k% # see if it worked
kill % # looks fine
% alias # now, look at all our alias
h history
k^@ kill % # hmmm...
% alias a%fb 'echo hello' # here's another fun one
% alias
a0.000000b echo hello # sounds like a way to get a SIGFPE sometime.
%
Isn't csh fun?
--
-=] Ford [=-
"The number of Unix installations (In Real Life: Mike Ditto)
has grown to 10, with more expected." ford at kenobi.cts.com
- The Unix Programmer's Manual, ...!sdcsvax!crash!elgar!ford
2nd Edition, June, 1972. ditto at cbmvax.commodore.com
More information about the Comp.bugs.4bsd.ucb-fixes
mailing list