[Ilugc] History Command

  • From: girish1729@xxxxxxxxx (Girish Venkatachalam)
  • Date: Thu Aug 17 15:55:38 2006




--- Binand Sethumadhavan <binand@xxxxxxxxx> wrote:

On 17/08/06, Girish Venkatachalam
<girish1729@xxxxxxxxx> wrote:
Assuming that I have five ptys in an X session. I
type
different commands in them. Now , I open a new
xterm
and then press Control-R. What is supposed to
happen?

I should be able to search for all the commands I
typed in the past , right?

This doesn't quite happen.

Well, the history file is written to the disk only
at the end of your
session (logout, or control-D, or exit, or
click-on-X or whatever).
Newer sessions read history from disk and not via
any IPC mechanism.
This is quite likely what your confusion is about?
Nice. Thanks!

I should have guessed that. But there is no reason why
you can't store these things in memory and retrieve
it. A few lines of simple C code can do it. No need
for any "fancy" IPC. Different bash instances could
maintain a shared mem area or some such thing. 

Anyway as a end user I don't get what I want. Hence
the "confusion."

Is there a chance for the history file not to be
written to disk due to a sudden power outage or some
such thing?

Then I hate the fact that it is written only during
normal situations. Maybe this explains why some
commands vanish into thin air.

This can be taken care of by periodically writing to
disk like the emacs auto save feature.

Well, one can argue all this is feature bloat, but
bash is already quite bloated; so nothing wrong in
making it a tad more bloated! :-)

regards,
Girish

Binand



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com ;

Other related posts: