Subject: Re: [A bit OT] csh prompt
To: None <cjep@fawlty.net>
From: None <cgd@broadcom.com>
List: port-pmax
Date: 09/26/2003 10:06:28
> set prompt="`whoami`@`hostname -s`-!>"
Yeah, stuff like that.
This is what I use (doesn't produce exactly what was asked for, but
one can get there with a little bit of work 8-):
set hostname=`hostname | sed -e 's/\..*//' | tr A-Z a-z`
if ( $?prompt ) then
if ( "`whoami`" == "root" ) then
set promptchar='#'
else
set promptchar='%'
endif
set promptmod=''
alias prmpt 'set prompt="\! [$hostname] $cwd:t ${promptmod}${promptchar} "'
alias cd "cd \!* ; prmpt"
alias pushd "pushd \!* ; prmpt"
alias popd "popd \!* ; prmpt"
cd $cwd
endif
That produces something like:
hist# [first_part_of_hostname] last_part_of_cwd %
and keeps it up to date as you move around. 8-)
cgd