history file sharing in ksh

William E. Davidsen Jr davidsen at steinmetz.ge.com
Wed Feb 15 02:24:06 AEST 1989


In article <2401 at crete.cs.glasgow.ac.uk> jack at cs.glasgow.ac.uk (Jack Campin) writes:
| Does anyone know what protocol ksh uses for sharing the history file when
| running multiple sessions?  I cannot make sense of what I see happening.  Does
| it act differently for shells run from distinct NFS clients than when all
| shells are on the same machine?  Is there any concurrency control at all?

  If you want to have separate history files for each session (I usually
run 3-5 connections on Xenix virtual terminals) you can do so by setting
the name of the HISTFILE variable. You can use something as simple as
the PID, or something a bit more informative, such as
	HISTFILE="/tmp/hist.$(basename $(tty))"
The advantage of this (at least with virtual terminals) is that you keep
the same history file for each terminal.

  Please note that you have to set HISTFILE *before* setting the editing
option, like "set -o emacs" or vi.
-- 
	bill davidsen		(wedu at ge-crd.arpa)
  {uunet | philabs}!steinmetz!crdos1!davidsen
"Stupidity, like virtue, is its own reward" -me



More information about the Comp.unix.questions mailing list