Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!romp!auschs!awdprime!doorstop.austin.ibm.com!tif From: tif@doorstop.austin.ibm.com (Paul Chamberlain) Newsgroups: comp.unix.shell Subject: Re: ksh prompt Message-ID: <5859@awdprime.UUCP> Date: 12 Mar 91 19:34:55 GMT References: <1991Mar8.234706.15343@cbnewsk.att.com> <1991Mar12.180408.26450@nijmeg> Sender: news@awdprime.UUCP Reply-To: tif@doorstop.austin.ibm.com (Paul Chamberlain) Organization: IBM AWD, Austin Lines: 21 In article <1991Mar12.180408.26450@nijmeg> clercqm@nijmeg (Marien de Clercq) writes: > PS1=`tput smso`'${SYSNAME} ${PWD#HOME/}-> '`tput rmso` This has caused me problems on some terminals since you never know what the escape sequence is gonna be. Sometimes it includes an exclamation point which causes many troubles (seems like a dollar sign might cause some problems too but I haven't had that problem ... yet). Furthermore, I seem to recall having problems when trying to do this in-line so I use: so="`tput smso`" so="`echo $so | sed -e 's/!/!!/g'`" ro="`tput rmso`" ro="`echo $ro | sed -e 's/!/!!/g'`" typeset PS1="$so${HOST}:\${PWD#\${PWD%/*/*/*}/}->$ro " unset so ro Obviously, that does some other things too. I'm not sure why I have the word "typeset" in there. (I even simplified this for posting!) Paul Chamberlain | I do NOT speak for IBM. IBM VNET: PAULCC AT AUSTIN 512/838-9748 | ...!cs.utexas.edu!ibmchs!auschs!doorstop.austin.ibm.com!tif