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 $BASH_VERSION > 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. Werner -- "Having a smoking section in a restaurant is like having a peeing section in a swimming pool." -- Edward Burr