C shell

Hi,

How do I set the shell prompt to show the current location I am ?

I know that in posix, I can do so by appending 'export PS1='$PWD ($LOGNAME)>' ' in my .profile.
But how about .cshrc?

regards
jennifer:(

hi!

'export' is not an internal command of the CSH shell. your .cshrc file should read:

set PWD=`pwd`
set LOGNAME="$USER"
set prompt="$PWD : $LOGNAME> "

Rgds
SHAIK

Hi,
You can also set the prompt with the current user in .cshrc with the 'whoami`command: e.g.

set prompt = "`whoami`: `hostname`%"

would produce the prompt:
currentuser:host%

Rgds,
Brian

Hi,
this might give you u another solution...

set prompt = "`echo $user\:$cwd` >> "

Regards,
Anent

Hi Jenny,
Had I understood what you want exactly,
you can try adding this line in your .cshrc

alias cd 'cd \!*;set prompt="`echo $cwd`> ";'

Hope this helps!

Wish you a Happy New Year
:slight_smile: