Path: utzoo!vpk4!shagar From: shagar@vpk4.UUCP (Steven Hagar) Newsgroups: comp.unix.questions Subject: Re: Getting UNIX prompt to display current directory Keywords: UNIX prompt directories pwd Message-ID: <4457@vpk4.UUCP> Date: 21 Mar 89 23:13:05 GMT References: <5582@ncsugn.ncsu.edu> <2187@solo11.cs.vu.nl> Reply-To: shagar@attcan.UUCP (Steven Hagar) Organization: AT&T Canada Inc., Toronto Lines: 38 The one thing that I didn't like about putting the current directory in PS1 was that if I was in something like "/usr/spool/uucppublic/receive/..." there wasn't much space left on the line to see the command I was typing. An alternate approach that I found useful was to display the current directory in the status field of my terminal. Here are the functions that I use within Bourne and Korn shells on AT&T terminals: case ${TERM} in 605|610|615) pd(){ cd $1 msg=`uname`": "`pwd` len=`expr 80 - "${msg}" : '.*'` sp=" " echo "^[7\033[x${sp}${sp}${sp}${sp}\c" echo "\033[25;${len}x${msg}^[8\c" };; 630) pd(){ cd $1 msg=`uname`": "`pwd` len=`expr "${msg}" : '.*'` echo "\033[?${len};2v${msg}\c" };; esac (suggestions for removing nasty terminal dependencies welcomed -- please send comments or questions via e-mail) -- Steven Hagar . AT&T Canada Inc. . ATTMAIL: !shagar (416) 756-5061 . UUCP: uunet!attcan!shagar