Bash tooltip - \ W intrepretation

I am trying to fix a curious problem that I am encountering with bash prompt (PS1) manipulation, and I am very confused why \ W is rewriting "pwd" incorrectly in my case.

user@server-01 :/repo$ PS1='${debian_chroot:+($debian_chroot)}\ u@ \h:\W\$ ' user@server-01 :rpoo$ user@server-01 :rpoo$ PS1='${debian_chroot:+($debian_chroot)}\ u@ \h:\w\$ ' user@server-01 :/repo$ 

The following / directories appear weird:

 /boot = bott /home = hmee /lib32 = li332 /lib64 = li664 /media = meiia /proc = pocc /repo = rpoo /sbin = sinn 

What I would like to know is that '\ W' shows 'rpoo' instead of 'repo' and the others above ... '\ w', on the other hand, displays the full path and the correct names as expected ?! I am not doing anything complicated with my hints, and I have the expression β€œfacter” in my bash prompt, but even returning to the defaults, I still see this funky replacement. This is the git repository directory, but this should not have anything to do with it. I have this problem only on two of the three servers that store this repository, other servers with the same bash.bashrc file work and work fine, without such a replacement \ W funky. Just deployed systems with the same prompt are in order.

I tried to find how or what \ W was configured without success, but \ w does not behave the same. Any help keeping this thing down ???

+4
source share

Source: https://habr.com/ru/post/1433453/


All Articles