# ~/.stdprompt # Put this in user's home dir, and source from their ~/.cshrc # # Sets up a date/time/pathname prompt for CSH and TCSH shells. # Also creates special prompts for super user logins. # # NOTE: We use `pwd` instead of $cwd so that when you 'cd' into a # directory, you see the ACTUAL PATH, and not a symbolic link path. # $cwd can ultimately cause confusion when using 'cd ..' in linked dirs. # # -erco@3dsite.com ### SET PROMPT ONLY IF A LOGIN SHELL if ( $?prompt ) then ### SPECIAL PROMPT IF SU'ED TO ROOT set rootmsg=""; if ( "`/usr/bin/id`" =~ "uid=0(root)"* ) set rootmsg=" ## ROOT ##" if ( $?tcsh ) then ### TCSH PROMPT alias precmd '/bin/date "+%n%a %D %T `/bin/pwd`"' set prompt="[%n@%m]${rootmsg} \! : " # %M=host.foo.com, %m=host # if ( $?REMOTEHOST ) set prompt="[%n@%m] %BRLOGIN${rootmsg}%b \! : " unalias cd; unalias pushd; unalias popd alias set_prompt "" else ### CSH PROMPT alias set_prompt 'source ~/.stdprompt_csh' alias cd 'chdir \!*; set_prompt' alias pushd 'pushd \!*; set_prompt' alias popd 'popd; set_prompt' set_prompt endif alias sprompt source ~/.stdprompt endif