Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!mcvax!unido!tub!tmpmbx!netmbx!blume From: blume@netmbx.UUCP (Heiko Blume) Newsgroups: comp.unix.questions Subject: Re: Getting UNIX prompt to display current directory Message-ID: <2412@netmbx.UUCP> Date: 21 Mar 89 17:48:01 GMT References: <5582@ncsugn.ncsu.edu> <2455@lindy.Stanford.EDU> Reply-To: blume@netmbx.UUCP (Heiko Blume) Organization: netmbx Public Access Unix, Berlin, West Germany Lines: 26 this sure is sort of ugly, but it works. you'll get a prompt like user@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@nosc.mil PSI =PSI%45300043109::netmbx:blume |BITNET=pro-cess.UUCP!blume@PSUVAX1 UUCP =blume@netmbx.UUCP |INET =blume@pro-cess.cts.com