On Mon, 30 Mar 2015 18:52, David Haller wrote:
On Sat, 28 Mar 2015, David C. Rankin wrote:
On 03/28/2015 04:03 PM, Yamaban wrote:
If someone can confirm 13.1 is ignoring 'erasedups', I'll file the bug.
Confirmed for openSUSE 12.3 and for 13.1, and it can be confirmed with and without 'timestamps' for the history ($HISTTIMEFORMAT).
Thank you,
Bug filed:
That is all weird, and, mind you, I use the same bash as you guys, even though I'm on 12.1 ;)
$ rpm -q bash bash-4.3-275.1.x86_64 $ rpm -q --changelog bash | head -2 * Wed Mar 04 2015 jdelvare@suse.de - bash-4.3-loadables.dif: One more warning fixed, in
So, I guess it's in libhistory / libreadline, but I think I use the same as well:
$ rpm -qf /lib64/libhistory.so.6.3 libreadline6-6.3-275.1.x86_64 $ rpm -q --changelog libreadline6 | head -2 * Wed Mar 04 2015 jdelvare@suse.de - bash-4.3-loadables.dif: One more warning fixed, in
I just tried a few "history -w", "ls foo", "history -w" from different xterms, and it all comes out as just one single entry each (one "ls" and one "history -w").
$ env | grep HIST HISTSIZE=50000 HISTFILESIZE=500000 HISTIGNORE=*PROMPT_COMMAND=* HISTCONTROL=ignoreboth:erasedups
==== man bash ==== HISTCONTROL A colon-separated list of values controlling how commands are saved on the history list. If the list of values includes ignorespace, lines which begin with a space character are not saved in the history list. A value of ignoredups causes lines matching the previous history entry to not be saved. A value of ignoreboth is shorthand for ignorespace and ignoredups. A value of erasedups causes all previous lines matching the current line to be removed from the history list before that line is saved. ====
I suspect you might be missing the 'ignoredups' value to HISTCONTROL ;)
$ wc -l ~/.bash_history 49410 /home/dh/.bash_history
Oh, my, gotta save that again to ".history.big" ... starting xterms etc. has become a tad slowish too (esp. if you start 10 at once as I do :)
$ cat ~/.bash_history >> ~/.bash_history.big $ mv -i ~/.bash_history ~/.bash_history.t $ tail -20000 ~/.bash_history.t > ~/.bash_history $ rm ~/.bash_history.t $ wc -l ~/.bash_history.big 587130 ~/.bash_history.big
HTH, -dnh
I'm using urxvt(d), small, fast, mostly compatible with xterm. Normal workflow uses ca 12 terms. Duplicate commands on different terms are a usual happening. In my .xinitrc I'm using a now 20 year old scriptlet, that copies the ~/.bash_history to a temp file, and appends it to a bigger saved history file (similar to dnh), then the temp file gets pumped into a perlscript that: 1: reads files of the .bash_history (with timestamps) format, 2: builds a hash with the command as key, and the timestamp as value, 3: for a existing key the value gets the bigger timestamp, 4: then a array is formed, for each key/value pair: '#${timestamp}\n${command}\n', 5: this array gets sorted by a self defined sorting sub (timestamp, then command) 6: and the whole, now uniq history gets written into ~/.bash_history This works for me, as I reboot the machine about once a month, and during that time I use suspend-to-disk for the nightly pause. A added 2-4 seconds on X11 login after reboot is acceptable for me. HISTSIZE=50000 HISTFILESIZE=500000 HISTCONTROL=ignorespace:erasedups HISTTIMEFORMAT="%F %T " - Yamaban. PS: if someone wants such a perlscript, please say so, and, yes, I know, nowadays it is possible to do such things in bash. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org