[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: history -f filename
From: |
Lawrence Velázquez |
Subject: |
Re: history -f filename |
Date: |
Sat, 30 Nov 2024 22:41:01 -0500 |
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
> CR> What exactly would this do?
>
> It would do just like plain
> $ history
> but instead of reading from the in memory list,
> (which is about the same as $HISTFILE + or - one line)
> it would read from the given file.
And what would be the point of this? You'd get a list of commands
prefixed with information that's useless (other than timestamps,
perhaps) because you haven't actually modified the history list.
--
vq