Getting UNIX prompt to display current directory

Heiko Blume blume at netmbx.UUCP
Wed Mar 22 03:48:01 AEST 1989


this sure is sort of ugly, but it works. you'll get a prompt like
user at host tty2A /usr/yourdir {23} 
if you put this in .login (NOT .cshrc or you'll get the prompt if you
fork a shell from another prgm. if you want the prompt in subshells too
there is another baad method.....) 
btw i threw in PushDir SwapDir FlipDir stack and POPdir.

alias a alias
if (! $?_d) set _d = ()
a pop	'cd $_d[1]; shift _d'
a pd	'set _d = (`pwd` $_d); cd \!*'
a sd	'set _d = ($_d[2] $_d[1] $_d[3-])'
a fd	'pd .; sd ; pop'
a stack 'echo $_d'
endif
umask 007
set x=`who am i` 
set me="$x[1]@`uname -n` $x[2]"
setenv me "$me"
a cd 'chdir \!*; set prompt="$me `pwd` {\\!} "'
set prompt="$me `pwd` {\!} "
-- 
Heiko Blume,Seekorso 29,D-1000 Berlin 22,VOICE=(+49 30)365 55 71,BBS=()365 75 01
TELEX=183003 intro d,FAX=()882 50 65|ARPA  =crash!pnet01!pro-cess!blume at nosc.mil
PSI  =PSI%45300043109::netmbx:blume |BITNET=pro-cess.UUCP!blume at PSUVAX1
UUCP =blume at netmbx.UUCP             |INET  =blume at pro-cess.cts.com



More information about the Comp.unix.questions mailing list