[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bash history weirdness
From: |
Chet Ramey |
Subject: |
Re: Bash history weirdness |
Date: |
Sun, 04 Oct 2009 13:19:51 -0400 |
User-agent: |
Thunderbird 2.0.0.23 (Macintosh/20090812) |
John wrote:
> Hi,
>
> Bash's history command is behaving oddly.
>
> If I do "history -w" then it writes the current history to
> ~/.bash_history as expected.
>
> But if I do "history -a" then ~/.bash_history doesn't get changed, and
> from the modification time it hasn't been touched at all.
Look at bashhist.c:maybe_append_history(). If bash doesn't think there
have been any new history entries during the current session
(history_lines_this_session must be > 0), or if those entries aren't past
where we are in the history (history_lines_this_session must be
< where_history()), it won't write anything to the history file.
If you want to debug it, that's where I'd start.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/