[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: |
Fri, 08 Dec 2023 11:13:32 +0100 |
Richard Stallman <rms@gnu.org> writes:
> [[[ To any NSA and FBI agents reading my email: please consider ]]]
> [[[ whether defending the US Constitution against all enemies, ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
>
> > > If two different shells will try to write history into one single file,
> > > are they doomed to give bad results, one way or another...
>
> > Not necessarily. If both shells use a single write() syscall on an
> > O_APPEND file, they should work as expected to my awareness.
>
> We are miscommunicating. The way you expect it to work is, in my
> opinion, a bad result -- various histories interspersed.
>
> It seems to me that the crucial thing is for each Bash process
> to have its own separate history.
>
> Do you think that behavior would be bad?
Bad? No. It's not what I'd prefer, though.
Note that, with either separate or interspersed histories, history
should never be lost, so, if a file is being shared by multiple shells
(even if it is not continuously re-read), care should be taken not to
lose data.
> > If a bash process decides to rotate the history file as a result of
> > HISTSIZE, and another bash process decides to do the same, one of their
> > new history entries would be lost due to the other one overriding it.
> > This would be a bug.
>
> Only if they share one single history file. If each has its own
> history file, each can handle it as if it were your only Bash process.
Indeed. How would these histories be recalled, though? Which file does
a new shell read?
--
Arsen Arsenović
signature.asc
Description: PGP signature
- Re: [OT] Not clobbering bash history, (continued)