prompt in cshell

Jeff Barber jeff at samna.UUCP
Wed Apr 11 03:59:58 AEST 1990


In article <1785 at watserv1.waterloo.edu> hazela at watserv1.waterloo.edu (Jose Reynaldo Setti) writes:
<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 >

A slight correction: the first three lines above should have all
the ' characters changed to ` characters.  Otherwise the shell
variables TTY and USER end up with the values: "basename ${TTY}"
and "logname" respectively which is clearly not what is wanted.
The ` character indicates that the output of the program between
the ` pairs is to be used.  Thus, with the replacements done, the
TTY and USER variables get the values "console" and "root".

Jeff



More information about the Comp.unix.i386 mailing list