bug-bash
[Top][All Lists]
Advanced

[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 16:10:23 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Tue, Mar 08, 2011 at 03:07:13PM +0100, Roman Rakus wrote:
> On 03/08/2011 12:32 PM, Dr. Werner Fink wrote:
> >Something like the attached patch.
> >
> Seems it doesn't work. I have applied your patch, run that bash in
> gnome-terminal, close the terminal. In gdb I set a break to atexit()
> and maybe_save_shell_history() functions. Bash receives SIGHUP, I say
> continue, bash again receives SIGHUP, again continue and bash ends.
> gdb is saying: Program terminated with signal SIGHUP, Hangup.
> 
> In man page of atexit:
> NOTES
>        Functions registered using atexit() (and on_exit(3)) are not
> called  if
>        a process terminates abnormally because of the delivery of a signal.
> 
> so I guess it won't work.

I'm aware of this ... but here is what I see:

  werner/bash> xterm -e bash -l
  [switch over to new xterm]
  address@hidden:/usr/src/werner/bash> echo $BASH_VERSION 
  4.2.7(1)-release
  address@hidden:/usr/src/werner/bash> echo ooo
  ooo
  [hangup due closing xterm]
  werner/bash> bash
  address@hidden:/usr/src/werner/bash> echo ooo

... it seems to work here.

If it does not work for you, you may try to add the
line

  int maybe_append_history (char *filename) __attribute__((destructor(1)));

before the definition of maybe_append_history() in bash-4.2/bashhist.c

   Werner

-- 
  "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]