ksh prompt

Paul Chamberlain tif at doorstop.austin.ibm.com
Wed Mar 13 05:34:55 AEST 1991


In article <1991Mar12.180408.26450 at nijmeg> clercqm at 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



More information about the Comp.unix.shell mailing list