[Top][All Lists]

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

Re: [bash-bug] no local bash_history created or written to if existing

From: Dr. Werner Fink
Subject: Re: [bash-bug] no local bash_history created or written to if existing (~/.bash_history
Date: Tue, 8 Mar 2011 11:29:22 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Mon, Mar 07, 2011 at 10:22:55PM -0500, Chet Ramey wrote:
> On 3/6/11 2:53 PM, Doug McMahon wrote:
> > with the current bash used in ubuntu 11.04 there no longer is a
> > ~/.bash_history created
> > If there is an existing ~/.bash_history in place or one is inadvertently
> > created, *see below, then it will not be written to
> Demonstrably false:
> (1)$ ./bash
> (2)$ HISTFILE=history
> (2)$ echo $BASH_VERSION
> 4.2.7(3)-maint
> (2)$ echo a
> a
> (2)$ exit
> exit
> (1)$ cat history
> HISTFILE=history
> echo a
> exit
> One thing that has changed is that an interactive shell will no longer
> attempt to write the history file if it's killed by a signal, since that
> causes many functions to be executed that are not safe to call from a
> signal handler.  If you're in the habit of trying to exit the shell by
> closing the terminal window, which causes the shell to be killed by SIGHUP
> (I think, maybe SIGTERM), the history will not be saved.

That will cause a lot of bugreports.  Just a question: could an atexit()
handler an option or an other way the bash could make use use an extra
(sig)longjmp()/(sig)setjmp() after increasing an atomic control variable
in the signal handlers for SIGHUP/SIGTERM to run all things done short
before exit.


  "Having a smoking section in a restaurant is like having
          a peeing section in a swimming pool." -- Edward Burr

reply via email to

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