Nasty shell bug

utzoo!decvax!harpo!npoiv!alice!rabbit!ark utzoo!decvax!harpo!npoiv!alice!rabbit!ark
Fri Oct 22 19:57:04 AEST 1982


I do not know what the situation is for csh, but what you describe
is in fact the proper operation of the Bourne Shell.  Suppose you type
the following string at your terminal:  "echo a b c " (note the trailing
space).  The echo command gets three arguments: "a", "b", and "c", with
no trailing white space.  Thus, if you say "echo $PS1" and PS1 contains
"$ ", it is as if you had said "echo $ ": the echo command gets a $ as
its argument with no trailing space.  The way to do it is to say:

		echo "$PS1"

I have tried this and the output does indeed have the trailing space.



More information about the Net.bugs mailing list