Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: $userdirs empty in non-interactive shells



2017-12-08 12:31:50 +0000, Peter Stephenson:
> On Fri, 8 Dec 2017 12:23:46 +0000
> Stephane Chazelas <stephane.chazelas@xxxxxxxxx> wrote:
> > BTW, I just realised that named dirs in variables took precedence
> > over user home dirs:
> > 
> > $ zsh -fc 'cd -P -- ~bin && pwd'
> > /bin
> > $ bin=/tmp zsh -fc 'cd -P -- ~bin && pwd'
> > /tmp
> > 
> > Is that intentional?
> 
> Yes, it allows you to override locations associated with users without
> jumping through lots of hoops.
[...]

Ah OK.

What would be a typical use case?

Is that the reason why named dirs were introduced in the first place?

-- 
Stephane



Messages sorted by: Reverse Date, Date, Thread, Author