$cwd in prompt???

James Cameron jc at raven.bu.edu
Tue Jun 18 16:13:04 AEST 1991


>>>>> On 18 Jun 91 03:41:07 GMT, bjsvec at cats.ucsc.edu (Brandon Jason Svec) said:



||> Can someone tell me how to get my prompt to show the current working 
||> directory?

||> I have tried something like this:

||> alias cd "cd;set prompt = $cwd"  # so it will update each time I cd
||> set prompt = $cwd

||> email please...
||> thanks,
||> brandon


Well, a basic solution to this would be this alias which could go in
either your .alias file if you have one, or .login:


alias cd 'cd \!*;set prompt = "$HOST [$cwd] % "'


which gives me when I am in my home directory:

raven [/u4/home/jc] % 


The above alias can be modified for X11 users to change the title 
and name of the current xterm.


jc

--
					-- James Cameron  (jc at raven.bu.edu)

Signal Processing and Interpretation Lab.  Boston, Mass  (617) 353-2879
------------------------------------------------------------------------------
"But to risk we must, for the greatest hazard in life is to risk nothing.  For
the man or woman who risks nothing, has nothing, does nothing, is nothing."
	(Quote from the eulogy for the late Christa McAuliffe.)



More information about the Comp.unix.questions mailing list