🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.4bsd
Article #1332

More csh bugs

#1332
From: Michael "Ford" Ditto
Date: Wed, 01 Feb 1989 00:56
35 lines
1596 bytes
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@kenobi.cts.com
- The Unix Programmer's Manual,		...!sdcsvax!crash!elgar!ford
  2nd Edition, June, 1972.		ditto@cbmvax.commodore.com
Technical Details
Message-ID: <5871@cbmvax.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!cbmvax!ditto
References: <14544@princeton.Princeton.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!cbmvax!ditto
From: ditto@cbmvax.UUCP (Michael "Ford" Ditto)
Newsgroups: comp.bugs.4bsd
Subject: More csh bugs
Summary: echo ${foo1}; alias k% 'kill %'; alias
Keywords: get the korn shell :-)
Message-ID: <5871@cbmvax.UUCP>
Date: 1 Feb 89 00:56:25 GMT
References: <14544@princeton.Princeton.EDU>
Reply-To: ditto@cbmvax.UUCP (Michael "Ford" Ditto)
Distribution: usa
Organization: Commodore Technology, West Chester, PA
Lines: 35