Nasty shell bug

utzoo!decvax!cca!z utzoo!decvax!cca!z
Fri Oct 22 12:14:09 AEST 1982


There is a nasty bug which exists in the C shell and the Bourne shell,
and which probably exists in other shells as well.  I was teaching my
EMACS how to talk to the C shell, so that it could do the popular trick
of starting up a shell in a window.  One thing that it has to know is
what the shell's prompt is, so that it can deal with it in various
situations.  Simple, right?  All you have to is say "echo $prompt" (or
"echo $PS1" for the Bourne shell) and look at the output.  Wrong!!!!
The string you get back from these commands never has a trailing space,
even if the prompt really does (which is the usual case)!  I killed an
hour and a half tracking this thing down, until I did a "script" and
looked at the results.  I suppose this was put in way back when in order
to save the cpu time of outputting that final space.  Besides, "nobody's
going to see it, anyway".  Sigh.

	Steve Zimmerman
	decvax!cca!z
	z at cca



More information about the Net.bugs mailing list