Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!husc6!cmcl2!nrl-cmf!ukma!gatech!emory!arnold
From: arnold@emory.uucp (Arnold D. Robbins {EUCC})
Newsgroups: comp.unix.wizards,comp.unix.questions
Subject: Re: The whole prompt string thing (was: PS1 and the bourne shell...)
Message-ID: <2368@emory.uucp>
Date: Thu, 3-Dec-87 12:08:46 EST
Article-I.D.: emory.2368
Posted: Thu Dec  3 12:08:46 1987
Date-Received: Mon, 7-Dec-87 06:18:42 EST
References: <279@caus-dp.UUCP> <1311@puff.wisc.edu> <137@anumb.UUCP> <207@jc3b21.UUCP> <305@caus-dp.UUCP>
Reply-To: arnold@emory.UUCP (Arnold D. Robbins {EUCC})
Organization: Emory University
Lines: 40
Xref: mnetor comp.unix.wizards:5778 comp.unix.questions:5185

In article <305@caus-dp.UUCP> marcos@caus-dp.UUCP (Marcos R. Della) writes:
[ ... we have gotten ]
>...nowhere. There are lots of interesting ideas and designs, but so far,
>nothing is working on this little problem. Has anyone out there actually
>done this and gotten it to work?

OK, Off the top of the head of an experienced shell hacker: In main.c
there is a line that says:

			prs(ps1nod.namval);

Change it to read

			prs (macro (ps1nod.namval));

Recompile and reinstall the shell. Then, in your .profile you
can say

	PS1='`pwd`> '

Note that this will run pwd for every prompt! If you have more patience,
add in the shell code a PWD shell variable that gets set every time you do
a 'cd', and then set PS1='$PWD> '. Note the single quotes.

If you have the S5R2 or later shell where pwd is built-in, then running pwd
each time is not such a big problem.

Or you could add your own pr_prompt function, put pr_prompt (ps1nod.namval)
into the code, and define your own semantics for printing the prompt.

In all cases, for BSD /bin/sh or S5R[23] /bin/sh, you have to modify the
code to get the result. Ksh already does things this way, so if you
have ksh it's not a problem.

Usual disclaimers apply; the suggestions above are untested.
-- 
Arnold Robbins
ARPA, CSNET:	arnold@emory.ARPA	BITNET: arnold@emory
UUCP: { decvax, gatech, }!emory!arnold	DOMAIN: arnold@emory.edu (soon)
	``csh: just say NO!''