bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

history -a misbehaves with $HISTSIZE


From: Айрат Васбикарамов
Subject: history -a misbehaves with $HISTSIZE
Date: Mon, 11 Feb 2019 00:59:37 +0300

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-unknown-linux-gnu' 
-DCONF_VENDOR='unknown' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' 
-DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib -D_FORTIFY_SOURCE=2 
-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt 
-DDEFAULT_PATH_VALUE='/usr/local/sbin:/usr/local/bin:/usr/bin' 
-DSTANDARD_UTILS_PATH='/usr/bin' -DSYS_BASHRC='/etc/bash.bashrc' 
-DSYS_BASH_LOGOUT='/etc/bash.bash_logout' -DNON_INTERACTIVE_LOGIN_SHELLS 
-Wno-parentheses -Wno-format-security
uname output: Linux glob 4.18.10-arch1-1-ARCH #1 SMP PREEMPT Wed Sep 26 
09:48:22 UTC 2018 x86_64 GNU/Linux
Machine Type: x86_64-unknown-linux-gnu
Bash Version: 4.4
Patch Level: 23
Release Status: release
Description:
$ history -c
$ HISTSIZE=2
$ HISTFILE=$(mktemp)
$ history -a
$ cat $HISTFILE
$
File is still empty!
bashhist.c:maybe_append_history():
if (history_lines_this_session > 0 && (history_lines_this_session <= 
where_history ()))
It seems like history_lines_this_session don't affected by HISTSIZE and it's 
value 3. But where_history() returns 2.
For example this sample works fine:
$ history -c
$ HISTSIZE=3
$ HISTFILE=$(mktemp)
$ history -a
$ cat $HISTFILE
HISTSIZE=3
HISTFILE=$(mktemp)
history -a
$

reply via email to

[Prev in Thread] Current Thread [Next in Thread]