Xref: utzoo unix-pc.sources:339 comp.sys.att:6903 Path: utzoo!yunexus!geac!becker!ziebmef!cks From: cks@ziebmef.uucp (Chris Siebenmann) Newsgroups: unix-pc.sources,comp.sys.att Subject: Re: KSHPR: prompt generator for .kshrc Message-ID: <1989Jul5.010413.25749@ziebmef.uucp> Date: 5 Jul 89 05:04:09 GMT Article-I.D.: ziebmef.1989Jul5.010413.25749 References: <19817@cup.portal.com> Reply-To: cks@ziebmef.UUCP (Chris Siebenmann) Organization: Ziebmef Public Access Unix, Toronto, Ontario Lines: 23 Here's the relevant bits from my .kshrc, which result in a prompt of the form : <'>' 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@ziebmef.UUCP or .....!utgpu!{,ontmoh!,ncrcan!brambo!}cks