[Top][All Lists]

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

Re: history -a

From: Chet Ramey
Subject: Re: history -a
Date: Fri, 13 Aug 2010 21:49:59 -0400
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv: Gecko/20100711 Lightning/1.0b1 Thunderbird/3.0.6

On 8/9/10 2:07 PM, Bruce Korb wrote:
> My history file isn't being updated as I am led to believe it ought to be.
> Is there some shopt or other thingey that keeps the history unwritten?
> I've googled the issue and the answer is supposed to be "history -a",
> on occasion, but that isn't working:

The current code in bashhist.c:maybe_append_history() (which has existed
for at least 15 years) seems to not handle the case where the number of
history lines in the current session is equal to the number of history
list entries.  That is, the code won't append new lines if it doesn't
think there were any lines read from the history file when the shell
started.  That seems wrong, and I've attached a patch that fixes it.
However, the code has existed in its current form for so long that I'm
wondering whether or not there is some other reason for it.


``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/

Attachment: history-append-patch
Description: Text document

reply via email to

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