Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!nrl-cmf!cmcl2!brl-adm!adm!H235-017%IRLEARN.BITNET@cunyvm.cuny.edu From: H235-017%IRLEARN.BITNET@cunyvm.cuny.edu (Mark Humphrys) Newsgroups: comp.unix.questions Subject: `pwd` in Shell prompt Message-ID: <12747@brl-adm.ARPA> Date: 1 Apr 88 00:28:49 GMT Sender: news@brl-adm.ARPA Lines: 30 Calling Unix hackers, Forgive me if this is an absurdly easy question but I am pretty new to Unix. I want to get the current directory to be automatically included in the Shell prompt. Now $ PS1="`pwd` > " works, but you have to type this in every time you change directory - not much use. Alas, in my naivety, I thought that the following program would change directory for me and change the prompt at the same time : cd $1 PS1="`pwd` > " export PS1 but it does absolutely nothing. The reason appears to be that a subprocess cannot alter its parent process. Is there any way around this? How does the Unix programmer/hacker survive without having a constant reminder of what directory he or she is in? Again, forgive me if this question is ridiculously easy. You can reply to me in person if you want, and we can have a good laugh about it. Mark Humphrys h235-017 at Irlearn " Humanity I love you because when you're hard up you pawn your intelligence to buy a drink."