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 t
On Mon, Dec 02, 2024 at 12:27:41PM -0800, Chet Ramey wrote:
> On 11/30/24 10:41 PM, Lawrence Velázquez wrote:
> > history_f() (
> > history -c &&
> > history -r -- "$1" &&
> > history
> > )
> > history_f .bash_history_foobar
>
> That *is* the `same P
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.
>
se ~/.bash_history.
> Alas, it also says
> history: history [-c] [-d offset] [n] or
> history -anrw [filename] or
> history -ps arg [arg...]
>
> So if one wants to use a filename, then one needs to use -anrw (-[anrw]).
>
> So maybe a new -f is needed:
> $ histo
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
suff
then reload the history from the temporary file.
All I want is a read-only operation.
CR> Because those are the options that act on the history file. The rest act
CR> on the in-memory history list.
So maybe a new -f is needed:
$ history -f filename
to simply read from filename.
CR>
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() (
On Sun, Dec 01, 2024 at 10:36:53 +0800, Dan Jacobson wrote:
> $ history |wc - $HISTFILE|sed \$d
>7622 75741 532254 -
> 14973 29625 320996 /home/jidanni/.bash_history_jidanni
> Works as expected.
So, you have 7622 lines of history in memory, and 14973 lines in
that file.
> $ (a=~/.bash
e than just one line).
All I want is a read-only operation.
CR> Because those are the options that act on the history file. The rest act
CR> on the in-memory history list.
>> So maybe a new -f is needed:
>> $ history -f filename
>> to simply read from filename.
CR> What
emory history list.
So maybe a new -f is needed:
$ history -f filename
to simply read from filename.
What exactly would this do?
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU
history -anrw [filename] or
history -ps arg [arg...]
So if one wants to use a filename, then one needs to use -anrw (-[anrw]).
So maybe a new -f is needed:
$ history -f filename
to simply read from filename.
11 matches
Mail list logo