On 11/4/14, 5:16 PM, Piotr Grzybowski wrote: > Chet: for reasons unexplained calls to read_history_range at > > history.def:219 > 219 result = read_history_range (filename, history_lines_in_file, > -1); > > return more and more records (77824 is above my HISTFILESIZE): > > 1: history_lines_in_file = 77824 > > the loop at histfile.c:269 in read_history_range is the one that hangs. > code at > commit ca6a2ba40c709c2b45a56e49d21d0dfc66e21974 > Date: Sun Oct 5 19:12:20 2014 -0400
I still can't reproduce it on OS X 10.10: (1)$ ./bash --rcfile bashrc (2)$ echo $BASH_VERSION 4.3.30(22)-release (2)$ ls -l $HISTFILE -rw------- 1 chet staff 402 Nov 5 08:49 history-file (2)$ wc -l < $HISTFILE 20 (2)$ echo $HISTSIZE $HISTFILESIZE 500000 500000 (2)$ for (( i = 0; i < 30 ; i++ )); do history -a ; history -n ; done (2)$ wc -l < $HISTFILE 25 (2)$ tail $HISTFILE ls ls exit PROMPT_COMMAND='history -a ; history -n' PROMPT_COMMAND='history -a ; history -n' echo $BASH_VERSION ls -l $HISTFILE wc -l < $HISTFILE echo $HISTSIZE $HISTFILESIZE for (( i = 0; i < 30 ; i++ )); do history -a ; history -n ; done (2)$ i=0; while [ $i -lt 30 ]; do history -a ; history -n; let i++; done (2)$ wc -l < $HISTFILE 28 (2)$ tail $HISTFILE PROMPT_COMMAND='history -a ; history -n' PROMPT_COMMAND='history -a ; history -n' echo $BASH_VERSION ls -l $HISTFILE wc -l < $HISTFILE echo $HISTSIZE $HISTFILESIZE for (( i = 0; i < 30 ; i++ )); do history -a ; history -n ; done wc -l < $HISTFILE tail $HISTFILE i=0; while [ $i -lt 30 ]; do history -a ; history -n; let i++; done There are issues with keeping track of the number of lines currently in the history file, but those occur at the boundary conditions where the number of commands in the history list approaches $HISTFILESIZE. That doesn't explain your results. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/