pwd prompts in unix

Gregory Ketell ketell at tolkien
Sun Jun 23 00:48:59 AEST 1991


How you set up your prompt depends on what shell you are running.  Here are
some methods I use.

CSH:
	Create two aliases in your .cshrc file
		alias cd	'cd \!*;promp'
		alias promp	'set prompt = "`hostname`:`pwd` ! > "'
	This will result in a prompt such as   tolkien:/usr/bin 23 > 
	which tells you which machine you are currently on, your path, and
	what history command you are on.

KSH:
	The Korn Shell has support for that built in.  All you do is set
	your prompt command in your .profile to something like
		PS1  $HOST:$PWD ! >
		export PS1
	and it will give you the same results as above.  
	(Please excuse me if this is not perfect.  I have not been on
	 the Korn Shell for quite some time.)

Good Luck,
Gregory G. Ketell
Director of Systems Engineering
Rimma Technologies, Inc. 
gketell at seq.csuhayward.edu



More information about the Comp.unix.wizards mailing list