bug-bash
[Top][All Lists]
Advanced

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

Re: Bash history when running several term sessions to same account


From: Paul Jarc
Subject: Re: Bash history when running several term sessions to same account
Date: Wed, 16 Jan 2002 13:14:07 -0500
User-agent: Gnus/5.090005 (Oort Gnus v0.05) Emacs/20.7 (i386-redhat-linux-gnu)

Chet Ramey <chet@nike.ins.cwru.edu> wrote:
>> And is "history -n" very intelligent?
>
> Define `very intelligent'.

Intelligent enough to make "history -n; history -a" work in
PROMPT_COMMAND, so that duplicates don't show up when two shells are
running concurrently, and so that things don't get very much out of
chronological order.  Then those shells would share a single history
list, which is what Keith is after, right?

> It keeps track of how many lines it thinks are in the history file
> and reads any lines after that one into the history list.

Does that also reset the number of history lines in the current
session, so that the just-read lines aren't re-appended with
"history -a"?

>> Would it work to put "history -n; history -a" in $PROMPT_COMMAND?
>
> You'd probably kill your disk doing it.

func() {
  local HISTFILE=file_on_ramdisk
  history -n
  history -a
}
PROMPT_COMMAND=func


paul



reply via email to

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