On Tue, Dec 26, 2000 at 08:15:39PM +0200, Oleg Goldshmidt wrote:
> Brilliant! Stupid me! I had
> 
> # 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 "$@"
>         xtitle ${HOSTNAME%%.*}: $PWD
> }
> 
> in .bashrc! Thanks!

Ahh... I once got bitten by such, and since then I always surround my
arguments with double quotes in scripts. I find it just as easy to
type and to read as the braces people usually put in.

Speaking of, by the way, I wonder why almost everybody I've seen who
digs smart xterm titles uses the cd trick instead of something like:

PS1_SIMPLE="\h: \w "
PS1="\[\033]0;${PS1_SIMPLE}\007\]${PS1_SIMPLE}"

=================================================================
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