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>


_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash

Reply via email to