prompt in cshell

Jose Reynaldo Setti hazela at watserv1.waterloo.edu
Mon Apr 9 07:31:32 AEST 1990


Some time ago there was a request for a prompt that
would tell where in the subdirectory structure you
were.

This is the way I do it, using the cshell. I wanted to
now whose account and which terminal I am on -- 
in a 386/ix SVR3.2. So I put the following lines in
.cshrc:

	set TTY='tty'
	set TTY="'basename ${TTY}'"
	set USER='logname'
	alias cd 'cd \!*; set prompt="${USER}@{TTY}:`pwd`>"'
	cd .

this gives me a prompt like:
root at console:/usr >
or
jrs at vt1:/usr/jrs/foo >

It should work if I typed all '"'s in the right places. If anycone
knows how to get a similar prompt in a better way, let me know.


jr setti	       hazela at watserv1.waterloo.edu [uwaterloo.ca]
the transport group -- dept. of civil engineering -- u of waterloo
waterloo, ontario, canada N2L 3G1



More information about the Comp.unix.i386 mailing list