UNIX prompts (-ksh)
Tom Neff
tneff at well.UUCP
Tue Mar 28 04:06:16 AEST 1989
In article <4549 at vpk4.UUCP> hjespers at attcan.UUCP (Hans Jespersen) writes:
>In article <2391 at buengc.BU.EDU> bph at buengc.bu.edu (Blair P. Houghton) writes:
>>In article <11080 at well.UUCP> tneff at well.UUCP (Tom Neff) writes:
>>>Actually not even the classic Korn shell solution of
>>>
>>> export PS1='$PWD> '
>>>
>>>seems to work everywhere.
>
>>I don't know ksh, but all the other shells I've seen use single-quotes
>>to protect against variable substitution...
>
>Absolutely correct. I think Tom ment
>
> export PS1=`$PWD> `
> ^ ^
>---------------------------------------------------------------------------
>Hans Jespersen UUCP: uunet!attcan!hjespers
>AT&T Canada Inc. or ..!attcan!nebulus!arakis!hans
>Toronto, Ontario #include <std.disclaimer>
Is this a forgery or did an AT&T employee really just suggest using
backquotes in the above example? The effect would be to attempt to
*execute* the current directory while redirecting stdout nowhere.
Actually the effect would be to set the prompt string to "syntax error"
or some variant thereof. :-)
I repeat, PS1='$PWD> ' -- with single quotes -- works under KornShell
Version 06/03/86d 386 Release 1.2, which is what I run. On other
systems I have used, you may have to use double quotes instead; under
whatever version of ksh they are running on my distributor's 3b2, not
even that works. Sometimes the symptom is unwanted early substitution
as alluded to by Jesperson; sometimes you can't get it to interpret in
any form, you just get a $PWD> in your face. Since ksh source is
available from the toolchest, I assume some versions I encounter have
been built on-site; perhaps there's a touchy spot in the area of the
code that works differently depending on your compiler. Who knows.
--
Tom Neff tneff at well.UUCP
or tneff at dasys1.UUCP
More information about the Comp.unix.questions
mailing list