emacs-tangents
[Top][All Lists]
Advanced

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

Re: [OT] Not clobbering bash history


From: Arsen Arsenović
Subject: Re: [OT] Not clobbering bash history
Date: Mon, 11 Dec 2023 13:09:52 +0100

Hi Jean,

Jean Louis <bugs@gnu.support> writes:

>>   > Say that the history has eight entries, and a ninth was added by a
>>   > parallel process, the current process would be at the point after the
>>   > eighth element and should continue reading from there next time it wants
>>   > a history entry.
>
> Arsen, explore options of the command `history' to do what you want,
> you can save history:
>
> $ history -a
>
> and you can re-read history file:
>
> $ history -r
>
> and by using those options you can mix history from different Bash
> sessions, and also re-use the history from other Bash session.

Thanks for the tip.  I already have something using these flags
implemented:

  PROMPT_COMMAND="$PROMPT_COMMAND;history -a; history -c; history -r")

which is a functional hack, for the most part.  It still has some of the
problems mentioned in my original message (history is only added to
after a command concludes, sporadic truncation still happens, etc), plus
this approach is rather ugly.

Thanks again, have a lovely day.
-- 
Arsen Arsenović

Attachment: signature.asc
Description: PGP signature


reply via email to

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