[Top][All Lists]

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

~0, ~00, etc tilde expand to ~CURRENTUSER

From: Emanuele Torre
Subject: ~0, ~00, etc tilde expand to ~CURRENTUSER
Date: Mon, 27 Dec 2021 00:08:01 +0100

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
-DSTANDARD_UTILS_PATH='/usr/bin' -DSYS_BASHRC='/etc/bash.bashrc'
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


    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.


    bash-5.1$ whoami
    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

reply via email to

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