Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!uunet!shared!davec From: davec@shared.uucp (Dave Close) Newsgroups: comp.unix.aix Subject: Re: How To: set PS1 to show users "current" directory? Keywords: AIX Message-ID: <1991Apr13.025012.13451@shared.uucp> Date: 13 Apr 91 02:50:12 GMT References: <1599@msa3b.UUCP> Organization: Shared Financial Systems, Dallas, TX Lines: 40 In article <1599@msa3b.UUCP> mgphl@msa3b.UUCP (Michael Phillips) writes: >Trying to set up AIX on a PS/2 & have users that want their command >prompt to show their current directory (aka: $P$G in **DOS). If you are using an xterm, either SVr4 or aixterm, the following might also be of use. It doesn't make your prompt so verbose and is always present. If installed in the ENV file for ksh of all users, the display even changes properly when you use 'su'. _cd () { unalias cd cd ${@} alias cd=_cd if [ "$(whoami)" = "root" ] ; then pmt=\# else pmt=\$ fi export PS1="^[]0;$(hostname -s):$(whoami) ${PWD}^G${pmt} " } [ "${TERM}" = "aixterm" -o "${TERM}" = "xterm" ] && { alias cd=_cd typeset -fx _cd if [ "$(whoami)" = "root" ] ; then pmt=\# else pmt=\$ fi PS1="^[]0;$(hostname -s):$(whoami) ${PWD}^G${pmt} " export PS1 } Note, replace the ^[ and ^G with actual escape and bell characters. There are trailing spaces on the lines with pmt=. -- Dave Close Shared Financial Systems Dallas davec@shared.com vmail +1 214 458 3850 uunet!shared!davec fax +1 214 458 3876 My comments are my opinions and may not be shared by Shared.