Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!oliveb!apple!well!tneff From: tneff@well.UUCP (Tom Neff) Newsgroups: comp.unix.questions Subject: Re: UNIX prompts (-ksh) Message-ID: <11134@well.UUCP> Date: 27 Mar 89 18:06:16 GMT References: <18805@adm.BRL.MIL> <11080@well.UUCP> <2391@buengc.BU.EDU> <4549@vpk4.UUCP> Reply-To: tneff@well.UUCP (Tom Neff) Organization: Whole Earth 'Lectronic Link, Sausalito, CA Lines: 41 In article <4549@vpk4.UUCP> hjespers@attcan.UUCP (Hans Jespersen) writes: >In article <2391@buengc.BU.EDU> bph@buengc.bu.edu (Blair P. Houghton) writes: >>In article <11080@well.UUCP> tneff@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 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@well.UUCP or tneff@dasys1.UUCP