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

Re: Weird expansion issue with (D)



Actually nevermind, I see now that using the variable "var" is being expanded, duh.

Is there any way to mark a specific variable name to NOT be expanded in this way?

Zach Riggle



On Thu, Aug 11, 2022 at 5:37 PM Zach Riggle <zachriggle@xxxxxxxxx> wrote:
Shouldn't the output be

~CODE_AUDIT_HELPERS/install.zsh

?

Zach Riggle



On Fri, Aug 5, 2022 at 11:54 AM Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx> wrote:
On Fri, Aug 5, 2022 at 6:37 PM Zach Riggle <zachriggle@xxxxxxxxx> wrote:
>
> I think I might have discovered a bug in the (D) expansion of named directories, and I'm not sure how to sort this out.
>
>     $ echo "${(D)PWD}"
>     ~CODE_AUDIT_HELPERS
>
>     $ var=$PWD/install.zsh
>
>     $ ls $var
>     /Users/zachriggle/.zprezto/modules/code-audit-helpers/install.zsh
>
>     $ echo "${(D)var}"
>     ~var
>
> Any ideas on what's happening here?  This is on zsh 5.8.1

This is working as expected assuming you've enabled auto_name_dirs.
This isn't the kind of option I would recommend enabling unless you
really know what you are doing.

Roman.


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