bug-bash
[Top][All Lists]
Advanced

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

Re: history -f filename


From: Chet Ramey
Subject: Re: history -f filename
Date: Mon, 2 Dec 2024 16:39:19 -0800
User-agent: Mozilla Thunderbird

On 12/2/24 5:05 PM, Lawrence Velázquez wrote:
On Mon, Dec 2, 2024, at 3:27 PM, Chet Ramey wrote:
On 11/30/24 10:41 PM, Lawrence Velázquez wrote:
On Sat, Nov 30, 2024, at 9:36 PM, Dan Jacobson wrote:
We see for simple
$ history
output, there's no way to change the file it reads, at least with the
current (same PID) shell.

Why is "same PID" a requirement?  Why isn't something like this
sufficient?

        history_f() (
                history -c &&
                history -r -- "$1" &&
                history
        )
        history_f .bash_history_foobar

That *is* the `same PID' shell.

Doesn't the subshell have a different PID?

No, you're right, I missed the parens.


--
``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/

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


reply via email to

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