bug-bash
[Top][All Lists]
Advanced

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

Re: Bash 3 and $HOME abbreviated with a tilde.


From: Chris F.A. Johnson
Subject: Re: Bash 3 and $HOME abbreviated with a tilde.
Date: Sun, 12 Jun 2005 12:48:36 -0400 (EDT)

On Sat, 11 Jun 2005, J.O. Aho wrote:


Got a bit irritated when updating my Gentoo boxes to use bash 3.00.16, the \W and \w options for the prompt now replaces the home directory name to tilde, I hope I'm not the only one who wants to see the home directory name instead of the tilde.

Wouldn't it be possible to see options \U and \u (just a suggestion) which behaives as \W and \w used to do under 2.05.

    AFAICT, there is no difference in behaviour between 2.05 and 3.00
    when using \w; there is for \W. (The documentation for bash3
    mentions both explicitly, which it didn't in bash 2.05.)

    If you want the full path (as in \w), use $PWD in PS1, e.g.:

PS1='$PWD \$ '


    If you want the basename (as in \W):

PS1='${PWD##*/} \$ '

--
    Chris F.A. Johnson                     <http://cfaj.freeshell.org>
    ==================================================================
    Shell Scripting Recipes: A Problem-Solution Approach, 2005, Apress
    <http://www.torfree.net/~chris/books/cfaj/ssr.html>




reply via email to

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