Prompt as Current Directory?

matt robinson yakker at ucrmath.UCR.EDU
Fri Nov 17 18:46:23 AEST 1989


==>In article <Nov.16.00.56.12.1989.9985 at paul.rutgers.edu> 
==>broadman at 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 at ucrmath.ucr.edu |  Matt Robinson, University of California at Riverside
..!ucsd!ucrmath!yakker |     Department of Mathematics and Computer Science
-----------------------*------------------------------------------------------



More information about the Comp.unix.questions mailing list