Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -DDEFAULT_PATH_VALUE='/usr/local/sbin:/usr/local/bin:/usr/bin' -DSTANDARD_UTILS_PATH='/usr/bin' -DSYS_BASHRC='/etc/bash.bashrc' -DSYS_BASH_LOGOUT='/etc/bash.bash_logout' -DNON_INTERACTIVE_LOGIN_SHELLS uname output: Linux t420 5.10.83-1-lts #1 SMP Wed, 01 Dec 2021 12:35:24 +0000 x86_64 GNU/Linux Machine Type: x86_64-pc-linux-gnu
Bash Version: 5.1 Patch Level: 12 Release Status: release Description: I have noticed that ~0 expands to the same value ~CURRENTUSER would expand to, instead of expanding to `~0' (i.e. not expanding). ~00, ~000, ~0000, etc have the same behaviour. Is this intended? It does not seem to be documented. Repeat-By: bash-5.1$ whoami emanuele6 bash-5.1$ echo ~/x ~emanuele6/x ~0/x /home/emanuele6/x /home/emanuele6/x /home/emanuele6/x bash-5.1$ HOME=yyy bash-5.1$ echo ~/x ~emanuele6/x ~000/x yyy/x /home/emanuele6/x /home/emanuele6/x bash-5.1$ echo ~0 ~0x0 ~020 ~1 ~10 /home/emanuele6 ~0x0 ~020 ~1 ~10