[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: PS1 \W behaviour: how to get the "old" way back?
From: |
Tim Waugh |
Subject: |
Re: PS1 \W behaviour: how to get the "old" way back? |
Date: |
Thu, 24 Feb 2005 14:38:25 +0000 |
User-agent: |
Mutt/1.4.2.1i |
On Wed, Feb 23, 2005 at 02:15:12PM -0500, Chet Ramey wrote:
> Unless I'm reading this wrong, ${PWD##*/} does the job (though it fails
> if PWD == '/'). You can always use $(basename $PWD).
Oh -- silly of me. I'd forgotten that PS1 gets expanded. ${PWD##/*/}
does what I want, except for the corner-case of '//'.
Thanks,
Tim.
*/
pgpggkUH1XvyA.pgp
Description: PGP signature