[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Suggestion] Flush command history to a "backup" file periodically
From: |
Chet Ramey |
Subject: |
Re: [Suggestion] Flush command history to a "backup" file periodically |
Date: |
Fri, 20 Jan 2023 09:52:06 -0500 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 |
On 1/19/23 7:08 PM, Peter wrote:
Currently, in the event bash or something below it crashes, that
session's command history is lost.
It would be nice if bash saved it somewhere periodically, it doesn't
have to be too often, let's say on every second command.
Use PROMPT_COMMAND to run `history -a' (or `history -w' if you're paranoid)
with whatever granularity you choose.
--
``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/