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