Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #16380

Changes to HISTIGNORE are not honored when changed via a reference?

From "James D. Lin" <jamesdlin@gmail.com>
Newsgroups gnu.bash.bug
Subject Changes to HISTIGNORE are not honored when changed via a reference?
Date 2020-06-13 15:17 -0700
Message-ID <mailman.1854.1592093058.2541.bug-bash@gnu.org> (permalink)
References <CADPatTfW9=Hh2kuDXjs7L3XByUgS+zqUq=c62J583J0SOWO0Mw@mail.gmail.com>

Show all headers | View raw


Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -g -O2
-fdebug-prefix-map=/build/bash-2bxm7h/bash-5.0=.
-fstack-protector-strong -Wformat -Werror=format-security -Wall
-Wno-parentheses -Wno-format-security
uname output: Linux debian 4.19.0-9-amd64 #1 SMP Debian
4.19.118-2+deb10u1 (2020-06-07) x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu

Bash Version: 5.0
Patch Level: 3
Release Status: release

Description:
If I modify the `HISTIGNORE` variable indirectly through a reference (e.g.
via `declare -n` or `local -n`), `HISTIGNORE` reflects the change, but the
change isn't honored.

Repeat-By:
$ HISTIGNORE=ls
$ history -c
$ ls
$ history
    1  history

`ls` is not listed, and `history` is, as expected.

$ declare -n historyref=HISTIGNORE
$ historyref=ls:history
$ echo $HISTIGNORE
ls:history
$ history -c
$ history
    1  history

`history` is still listed, despite being included by `HISTIGNORE`.

$ HISTIGNORE=$HISTIGNORE
$ history -c
$ history

Now nothing is printed, as expected.

- James

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Changes to HISTIGNORE are not honored when changed via a reference? "James D. Lin" <jamesdlin@gmail.com> - 2020-06-13 15:17 -0700

csiph-web