bug-bash
[Top][All Lists]
Advanced

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

[bash-5.2] array assignment caused bash to stop saving history


From: Clark Wang
Subject: [bash-5.2] array assignment caused bash to stop saving history
Date: Wed, 15 Jun 2022 15:00:45 +0800

Very often Bash 5.2 would suddenly stop saving command history which
has been confusing me for quite some time. Today I did some debugging
and came up with the following minimal scenario to reproduce the
problem.


$ bash --version
GNU bash, version 5.2.0(18)-beta (x86_64-apple-darwin21.5.0)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ bash --norc
bash-5.2$ true 111
bash-5.2$ history 2
  501  true 111
  502  history 2
bash-5.2$ arr=()
bash-5.2$ true 222
bash-5.2$ history 2
  502  history 2
  503  arr=()
bash-5.2$


As we can see, after `arr=()' the command `true 222' is not saved to history.

-clark



reply via email to

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