[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tramp smashes my .bash_history file

From: Tim Connors
Subject: Re: tramp smashes my .bash_history file
Date: Tue, 21 Oct 2003 15:25:30 +1000 (EST)

On Tue, 21 Oct 2003, Tim Connors wrote:

> On Mon, 20 Oct 2003, Kai Grossjohann wrote:
> > Oh!  Tramp usually starts /bin/sh when connecting to the remote end.
> > Maybe that shell groks $HISTFILE but not $HISTSIZE?
> Reread the pargraph before my (1), and you answered yourself :)
> > What happens when you manually connect there and issue "exec /bin/sh"
> > and then try to frob $HISTFILE and $HISTSIZE?
> Because I don't have a tramp/foo buffer, I can't test this, but perhaps
> the OP can test it?

And I can see why it only affects users of Solaris/OSF etc - bsaically,
anything where sh is not a symlink to bash:

Here's the login sequence:
$ # Waiting 30s for `HISTFILE=$HOME/.tramp_history; HISTSIZE=1'
$ HISTFILE=$HOME/.tramp_history; HISTSIZE=1
$ # Waiting 30s for `set +o vi +o emacs'
$ set +o vi +o emacs
+o: bad option(s)
$ # Waiting 30s for `unset MAIL MAILCHECK MAILPATH'
$ unset MAIL MAILCHECK MAILPATH 1>/dev/null 2>/dev/null
$ # Waiting 30s for `unset CDPATH'
$ unset CDPATH
$ # Setting shell prompt
$ PS1='
'; PS2=''; PS3=''
$ echo ~root
$ while read d; do if test -x $d/bash -a -f $d/bash; then echo
tramp_executable $d/bash; break; fi; done <<'EOF'
$ /bin
$ /usr/bin
$ /usr/sbin
$ /usr/local/bin
$ /home/office/tconnors/bin
$ /home/office/tconnors/bin/Linux
$ /home/tconnors/bin
$ /home/tconnors/bin/Linux
$ /usr/ucb
$ /usr/bin/X11
tramp_executable /home/tconnors/bin/bash
# Starting remote shell `/home/tconnors/bin/bash -norc -noprofile' for
tilde expansion...
$ PS1='$ ' exec /home/tconnors/bin/bash -norc -noprofile
$ # Setting remote shell prompt...
# Setting remote shell prompt...done
# Finding command to check if file exists

So my /bin/sh doesn't do tilde expansion, so tramp tries again with bash.
But it forgets all the settings we made earlier, because they weren't
exported. This holds for all the settings - and given that some things
were unset, perhaps we should just repeat everything we just did after
starting the new shell, rather than exporting things left right and centre?

I'll leave this to the experts. Kai? ;)

TimC --
Modus Ponens in action:
- Nothing is better than world peace.
- A turkey sandwich is better than nothing.
  ==>  Ergo, a turkey sandwich is better than world peace.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]