[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug] Home dir in PS1 not abbreviated to tilde
From: |
Clark J. Wang |
Subject: |
Re: [bug] Home dir in PS1 not abbreviated to tilde |
Date: |
Tue, 13 Mar 2012 13:04:05 +0800 |
On Mon, Mar 12, 2012 at 12:22, Yongzhi Pan <panyongzhi@gmail.com> wrote:
> Tested in GNU bash, version 3.00.16(1)-release and 4.1.2(1)-release.
>
> Upon login, home dir is displayed as tilde in PS1:
> pan@BJ-APN-2 ~$ echo $PS1
> \[\033[35m\]\u@\h \w$ \[\033[0m\]
> pan@BJ-APN-2 ~$ pwd
> /export/home/pan/
>
> After a cd command, which change directory to $HOME (not changed at all),
> it is displayed as the complete path:
> pan@BJ-APN-2 ~$ cd
> pan@BJ-APN-2 /export/home/pan$
>
> The reason is that my home in passwd has a trailing slash:
> pan@BJ-APN-2 /export/home/pan$ grep ^$USER: /etc/passwd
> pan:x:896:1::/export/home/pan/:/bin/bash
>
You can also reproduce this by directly setting HOME to
`/export/home/pan/'.
> This is tricky to find. I hope it will display tilde even if home dir entry
> in passwd has one or more trailing slash.
>
I personally don't think this needs to be fixed. :)
>
> PS: I read the source code and do not know where this is done, maybe in
> y.tab.c?
>
- [bug] Home dir in PS1 not abbreviated to tilde, Yongzhi Pan, 2012/03/12
- Re: [bug] Home dir in PS1 not abbreviated to tilde,
Clark J. Wang <=
- Re: [bug] Home dir in PS1 not abbreviated to tilde, dethrophes, 2012/03/13
- Re: [bug] Home dir in PS1 not abbreviated to tilde, Roman Rakus, 2012/03/13
- Re: [bug] Home dir in PS1 not abbreviated to tilde, Eric Blake, 2012/03/13
- Re: [bug] Home dir in PS1 not abbreviated to tilde, dethrophes, 2012/03/13
- Re: [bug] Home dir in PS1 not abbreviated to tilde, Eric Blake, 2012/03/13
- Re: [bug] Home dir in PS1 not abbreviated to tilde, dethrophes, 2012/03/13
- Re: [bug] Home dir in PS1 not abbreviated to tilde, Eric Blake, 2012/03/13
- Re: [bug] Home dir in PS1 not abbreviated to tilde, dethrophes, 2012/03/13
- Re: [bug] Home dir in PS1 not abbreviated to tilde, Andreas Schwab, 2012/03/13
- Re: [bug] Home dir in PS1 not abbreviated to tilde, dethrophes, 2012/03/13