Re: Race Conditions

[prev] [thread] [next] [lurker] [Date index for 2006/07/04]

From: Aaron Crane
Subject: Re: Race Conditions
Date: 09:44 on 04 Jul 2006
Yossi Kreinin writes:
> Of course I lost the history of the 10 shells I was running, and was left
> with a completely useless one from hell knows when. Saving the history of
> several shells under files named just like the "session name" is apparently
> a notoriously hard problem - after all, 20 years are not enough to solve
> it.

Your hate about the Linux OOM killer is well founded.  This should help with
the shell history hatefulness:

  # Append to the history file on shell exit, don't overwrite (so multiple
  # exiting shells don't race to scribble over your saved history)
  shopt -s histappend

  # Keep lots of history around
  export HISTSIZE=1000000 HISTFILESIZE=1000000

  # Store history in a different file, so it won't get overwritten if you
  # don't have these settings
  export HISTFILE=~/.bash_history_safe

  # Write unsaved history immediately before emitting each prompt
  export PROMPT_COMMAND='history -a'

It's still hateful that you need five separate "unbreak me" options, of
course.

-- 
Aaron Crane
There's stuff above here

Generated at 09:01 on 07 Jul 2006 by mariachi 0.52