bug-bash
[Top][All Lists]
Advanced

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

hash not restored after running command -p


From: Roger Morris
Subject: hash not restored after running command -p
Date: Fri, 29 Oct 2021 18:06:43 -0400

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -g -O2
-fdebug-prefix-map=/build/bash-a6qmCk/bash-5.0=.
-fstack-protector-strong -Wformat -Werror=format-security -Wall
-Wno-parentheses -Wno-format-security
uname output: Linux lily 5.4.0-89-generic #100-Ubuntu SMP Fri Sep 24
14:50:10 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu

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

Description:
I believe there's a bug in bash 4.4 (and still in 5.1) that wasn't
there in 4.3.30

When 'command -p' runs, it no longer seems to restore the hash to its
previous value.

No-bug example from 4.3.30:
rsm@lily:~/bbbbash/bash-4.3.30$ echo $BASH_VERSION
4.3.30(1)-release
rsm@lily:~/bbbbash/bash-4.3.30$ export PATH=
rsm@lily:~/bbbbash/bash-4.3.30$ hostname
bash: hostname: No such file or directory
rsm@lily:~/bbbbash/bash-4.3.30$ command -p hostname
lily
rsm@lily:~/bbbbash/bash-4.3.30$ hostname
bash: hostname: No such file or directory
rsm@lily:~/bbbbash/bash-4.3.30$

Bug example from 4.4:
rsm@lily:~/bbbbash/bash-4.4$ echo $BASH_VERSION
4.4.0(1)-release
rsm@lily:~/bbbbash/bash-4.4$ export PATH=
rsm@lily:~/bbbbash/bash-4.4$ hostname
bash: hostname: No such file or directory
rsm@lily:~/bbbbash/bash-4.4$ command -p hostname
lily
rsm@lily:~/bbbbash/bash-4.4$ hostname
lily
rsm@lily:~/bbbbash/bash-4.4$ # ^^^^^ THIS SHOULDN'T HAVE WORKED. ^^^^
rsm@lily:~/bbbbash/bash-4.4$
rsm@lily:~/bbbbash/bash-4.4$ echo $PATH

rsm@lily:~/bbbbash/bash-4.4$

As you can see, the path to 'hostname' remains in the hash in 4.4

Repeat-By:
Follow example above



reply via email to

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