bug-bash
[Top][All Lists]
Advanced

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

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


From: James D. Lin
Subject: Changes to HISTIGNORE are not honored when changed via a reference?
Date: Sat, 13 Jun 2020 15:17:05 -0700

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



reply via email to

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