On 2021/01/21 11:43, Chet Ramey wrote:
On 1/21/21 11:18 AM, Merijn Verstraaten wrote:
The history command doesn't seem to work when given a FIFO instead of a file. I was trying to load
history from FIFO using either 'history -r <(echo "$hist")' or 'echo "$hist" |
history -r /dev/stdin', but neither of these seem to work, due to the command being unable to handle
FIFOs.
Correct. The history file reading code requires the history file be a
regular file. This is because the technique it uses to read and process
the file (mmap or read the file in one read into a large buffer, then
move around in the buffer) doesn't work with non-regular files.
There are two stages in readline -- being able to read previous
history and then recording to a history file. Isn't it possible
to load from one place (which would get copied to the 2nd as older history)
and then bash move around to delete dups as needed in the new file?