Path: utzoo!utgpu!watmath!att!ucbvax!tut.cis.ohio-state.edu!ucsd!ucrmath!yakker From: yakker@ucrmath.UCR.EDU (matt robinson) Newsgroups: comp.unix.questions Subject: Re: Prompt as Current Directory? Message-ID: <2611@ucrmath.UCR.EDU> Date: 17 Nov 89 07:46:23 GMT References: <1637@pyrltd.UUCP> Reply-To: yakker@ucrmath.UUCP (matt robinson) Followup-To: yakker@ucrmath.ucr.edu Organization: University of California, Riverside Lines: 32 ==>In article ==>broadman@paul.rutgers.edu (Alan Broadman) writes: ==>How can you get the UNIX prompt to always reflect the path to the ==>current directory. This is our school's method (Recipe #3,402) :-) It also includes the path, username, and current history (for csh.) Hope this helps. >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< # Setting the Prompt and Changing Directories. set hostname = `hostname` set username = `whoami` set fromname = `who am i | awk '{print $1}' | sed 's/^.*\\\!//'` if ("$fromname" != "$username") then set username="$username"' ('"$fromname"')' endif alias heyyou 'set prompt = "$hostname : $username : `pwd`\\ \! >"' set prompt = "$hostname : $username : `pwd`\ \! >" a cd 'cd \!*;heyyou' a pushd 'pushd \!*;heyyou' a popd 'popd;heyyou' >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< P.S. You should have read the newusers newsgroup before posting this... Makes life easier on all of us. -----------------------*------------------------------------------------------ yakker@ucrmath.ucr.edu | Matt Robinson, University of California at Riverside ..!ucsd!ucrmath!yakker | Department of Mathematics and Computer Science -----------------------*------------------------------------------------------