bash 3.1 gotcha

Chris Adams cmadams at
Thu Jan 12 19:31:55 UTC 2006

Once upon a time, Callum Lerwick <seg at> said:
> For many years, I have had a fancy bash prompt, that contains this:
> ${PWD/#$HOME/~} This replaces your home dir with a tilde. However, with
> bash 3.1, it stopped working:

Why not just use the bash PS1 "\w" escape which does the same thing?
Much easier and won't break (unless there's a bug).  See the PROMPTING
secion of the bash man page.
Chris Adams <cmadams at>
Systems and Network Administrator - HiWAAY Internet Services
I don't speak for anybody but myself - that's enough trouble.

More information about the fedora-devel-list mailing list