Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
bash-5.2_p26-r6 HISTSIZE & HISTFILESIZE variables
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
sdauth
l33t
l33t


Joined: 19 Sep 2018
Posts: 616
Location: Ásgarðr

PostPosted: Wed Jul 03, 2024 7:18 pm    Post subject: bash-5.2_p26-r6 HISTSIZE & HISTFILESIZE variables Reply with quote

Hello,
With bash-5.2_p26-r6, if I don't set HISTSIZE & HISTFILESIZE in my ~/.bashrc; I observe the creation of lot of .bash_history-******.tmp files appearing randomly (some even empty) in my ~/
This wasn't needed with previous bash-5.1 series. Or at least I never observed this behaviour.
I was finally able to solve the issue by setting those variables in my ~/.bashrc. I added HISTCONTROL too for good measure.

HISTCONTROL=ignorespace:ignoredups
HISTSIZE=10000
HISTFILESIZE=20000

If anyone have an explanation or maybe it is unrelated and just coincidence.. :lol: At least if it can help anyone with the same issue, that's a good thing.

Cheers
Back to top
View user's profile Send private message
RumpletonBongworth
n00b
n00b


Joined: 17 Jun 2024
Posts: 62

PostPosted: Wed Jul 03, 2024 9:28 pm    Post subject: Reply with quote

I noticed some lingering temporary files on one of my machines, dating from several months ago. As far as I can tell, nothing has changed in 5.2 that would make it any more or less likely for one of the syscalls to fail in such a way that a temporary file remains. It could have just been an anomaly but I did notice something potentially interesting: the length of the temporary files was exactly that of the values of HISTSIZE and HISTFILESIZE at the time. I don't have an explanation for this but it's on my radar, so to speak.
Back to top
View user's profile Send private message
sdauth
l33t
l33t


Joined: 19 Sep 2018
Posts: 616
Location: Ásgarðr

PostPosted: Fri Jul 05, 2024 3:47 pm    Post subject: Reply with quote

RumpletonBongworth wrote:
the length of the temporary files was exactly that of the values of HISTSIZE and HISTFILESIZE at the time. I don't have an explanation for this but it's on my radar, so to speak.


Interesting, what values were you using when you noticed this ?
I think the default is 500 for HISTSIZE (when not set in ~/.bashrc)

In Debian, the default ~/.bashrc set the following :

Code:
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000


Which seems too low because I have the same issue with Debian if I use these values.
Instead I set :

Code:
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=10000
HISTFILESIZE=20000


And no more tmp files cluttering my home folder. (like hundred of them..)
Strangely the issue started to happen with Debian bookworm (12), current stable, which introduced bash 5.2. With oldstable (Bullseye), I never saw those history tmp files.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum