Chris Marshall writes:
> > Will it cause problems if I have 2 PDL terminals open
> > simultaneously? Will both record to the history file,
> > or will they overwrite each other?
>
> Yes, the flush to file just dumps the last 250 lines of
> history over the current file and there is no locking.
> My bash shells have the same problem.
...unless you enable |histappend| with `shopt -s histappend'.
> In practice, the flushing is every 10 user commands
> so it is unlikely that you would type the 10th command
> in at the same time in two perldl instances so the file
> locking would not be the issue. The history overwrite
> would be a problem.
>
> I would suggest two possible work arounds:
>
> (1) modify the flhist() to use a different file name for
> each perldl instance, or
> (2) use the same HIST file name but change the
> overwrite to append instead.
There are better ways of dealing with this. In tcsh, e.g., I have set
savehist = (1000 merge)
which gives me 1000 lines of history and _merges_ the current shell's
history into ~/.history when the shell quits. This means that
the history list is merged with the existing history file instead of
replacing it (if there is one) and sorted by time stamp. (+) Merging is
intended for an environment like the X Window System with several shells
in simultaneous use. Currently it succeeds only when the shells quit
nicely one after another.
, and is _extremely_ useful.
Actually, Bash can at least do the appending:
If the histappend shell option is enabled (see the description of
shopt under SHELL BUILTIN COMMANDS below), the lines are appended to
the history file, otherwise the history file is over- written.
[Some distros (like Gentoo) enable this by default, and it is difficult to
imagine why it should be disabled.]
I wonder how much of this is already in readline and just needs to be
activated. [Hmm, maybe not that much:
http://tiswww.case.edu/php/chet/readline/history.html#SEC15].
> (Do you have any interest in contributing to PDL development? Many
> hands makes light work...)
Very true, but unfortunately I currently can't commit to this at all.
Maybe at some time in the future... after my children's retirement...
W o l f g a n g
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl