Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!burl!codas!killer!wnp From: wnp@killer.UUCP Newsgroups: comp.unix.questions Subject: Re: PS1 to show working dir Message-ID: <2143@killer.UUCP> Date: Wed, 18-Nov-87 21:25:05 EST Article-I.D.: killer.2143 Posted: Wed Nov 18 21:25:05 1987 Date-Received: Sat, 21-Nov-87 08:34:37 EST References: <735@auscso.UUCP> Reply-To: wnp@killer.UUCP (Wolf Paul) Organization: The Unix(tm) Connection BBS, Dallas, Tx Lines: 27 In article <735@auscso.UUCP> johnk@auscso.UUCP (John Knutson) writes: >It is possible, but since i don't know what machine or os or version you're >running on (the only article i saw was a reply with NO included lines). >Here, (ksh on sysv.3) PS1="`pwd` !$"; export PS1 will do the trick. will look >like: /usr2/auug/johnk 5$ Pnews ; or whatever. I could even do something >like: >PS1="`cat $HOME/.signature` What?? " > ... Problem with that is that it sets the prompt to whatever the CWD was when you typed PS1="`pwd`...". In other words, it does not get updated every time you cd to a different directory. Some versions of the Bourne shell maintain a variable $PWD which gets updated every time you cd, and if that's true for your version of the shell, PS1="\$PWD >";export PS1 will create a prompt that is updated every time you cd. I have seen other variable names uses for this purpose; to find out what variable tu use on your system type "set", then "cd ..", then "set" again, and check which variables reflect this change in your current directory. One other name I've seen used for this is $CWD, or $cwd on BSD systems. Wolf Paul ihnp4!killer!dcs!wnp