Right justification in putty title bar
am 16.04.2008 16:15:07 von jaredsubmanI'd like to do is have the short hostname, of the title bar of my
putty window in the far upper left-hand corner, followed by the date
in the far upper right-hand corner.
Currently, this is what I have in my .bashrc:
export HOST=$(echo $HOSTNAME |cut -d"." -f1)
export DATE=$(date +%a" "%b" "%d)
export TERM=xterm
printf "\033]0;$HOST%160s$DATE\007"
(Also, why would this be 160 and not
80???)
It works reasonably well except for when the hostname is too long at
which time the date scrolls off the title bar :
What I would really like to do for the date piece is something like
this:
printf "%80s" "$DATE"
which keeps the DATE right-justified at the command prompt but not in
my .bashrc.
What am I doing wrong?
Any help would be much appreciated. Thanks in advance.