[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Temporary history file not being removed from home directory
From: |
Chet Ramey |
Subject: |
Re: Temporary history file not being removed from home directory |
Date: |
Mon, 9 Sep 2024 10:02:01 -0400 |
User-agent: |
Mozilla Thunderbird |
On 9/7/24 6:04 AM, Dmytro Bagrii wrote:
Bash Version: 5.2
Patch Level: 32
Release Status: release
Description:
Sometimes .bash_history-XXXXX.tmp file remains present in $HOME directory.
Both ~/.bash_history and ~.bash_history-XXXXX.tmp are 65536 lines long, as
specified by $HISTFILESIZE.
~/.bash_history-XXXXX.tmp contain older commands and doesn't contain more
recent commands, as expected.
After manual removal of ~/.bash_history-XXXXX.tmp after some time new tmp
file emerges.
This doesn't seem like the whole story. You probably have PROMPT_COMMAND
set to append the history at every command (otherwise, the temp file would
not `reappear' after some time).
It looks like one of the writes or renames fails, so the history library
leaves the temp file there in case it needs to be manually modified, but
a subsequent write succeeds, updating the `real' history file.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/
OpenPGP_signature.asc
Description: OpenPGP digital signature