If we are sharing silly shell tips, this one is a golden oldie.
Here is a variant I have in my .bashrc :

#############################################################

# let the xterm titlebar show the current dir
xtitle() {
        if [ "$TERM" = "xterm" ]; then
                echo -n -e "\033]0;$@\007" >/dev/tty
        fi
}

# Change the 'cd' 'pushd' 'popd' commands to use xtitle()
cd() {
        builtin cd $1
        xtitle ${HOSTNAME%%.*}: $PWD
}

pushd() {
        builtin pushd $1
        xtitle ${HOSTNAME%%.*}: $PWD
}

popd() {
        builtin popd $1
        xtitle ${HOSTNAME%%.*}: $PWD
}

# this will set the title upon invocation of an xterm
cd .

###############################################################

-- 
Oleg Goldshmidt | BLOOMBERG L.P. (BFM) | [EMAIL PROTECTED]
"... We work by wit, and not by witchcraft;
 And wit depends on dilatory time." - W. Shakespeare.

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to