[Top][All Lists]

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

Re: History -r breaks on FIFOs

From: L A Walsh
Subject: Re: History -r breaks on FIFOs
Date: Thu, 21 Jan 2021 21:31:33 -0800
User-agent: Thunderbird (Windows/20100228)

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 

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?

reply via email to

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