KSHPR: prompt generator for .kshrc

Chris Siebenmann cks at ziebmef.uucp
Wed Jul 5 15:04:09 AEST 1989


 Here's the relevant bits from my .kshrc, which result in a prompt of
the form
	<user>:<terminal> <command #> <'>' or '#' if I'm root>
(eg "cks:w1 71 > " or "root:w1 1 # ")

	uid=`id | sed 's/uid=[0-9]*(//
		       s/).*//'`
	ttyp=`tty | sed 's;/dev/;;'`
	case $uid in
		root) prompter="#";;
		*) prompter=">";;
	esac
	PS1="$uid:$ttyp ! $prompter "

 Ah, the things one can do in ksh. Anyone want an emulation of the BSD
csh pushd/popd commands?

-- 
	"Oh BLESS you, sir! The ANGEL OF DEATH was after me just as SURE as
	 you're standing there, yes he WAS!"
Chris Siebenmann		uunet!{utgpu!moore,attcan!telly}!ziebmef!cks
cks at ziebmef.UUCP	     or	.....!utgpu!{,ontmoh!,ncrcan!brambo!}cks



More information about the Unix-pc.sources mailing list