zsh-users
 help / color / mirror / code / Atom feed
* Weird expansion issue with (D)
@ 2022-08-05 16:36 Zach Riggle
  2022-08-05 16:54 ` Roman Perepelitsa
  0 siblings, 1 reply; 5+ messages in thread
From: Zach Riggle @ 2022-08-05 16:36 UTC (permalink / raw)
  To: Zsh Users

[-- Attachment #1: Type: text/plain, Size: 388 bytes --]

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

*Zach Riggle*

[-- Attachment #2: Type: text/html, Size: 839 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Weird expansion issue with (D)
  2022-08-05 16:36 Weird expansion issue with (D) Zach Riggle
@ 2022-08-05 16:54 ` Roman Perepelitsa
  2022-08-11 22:37   ` Zach Riggle
  0 siblings, 1 reply; 5+ messages in thread
From: Roman Perepelitsa @ 2022-08-05 16:54 UTC (permalink / raw)
  To: Zach Riggle; +Cc: Zsh Users

On Fri, Aug 5, 2022 at 6:37 PM Zach Riggle <zachriggle@gmail.com> 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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Weird expansion issue with (D)
  2022-08-05 16:54 ` Roman Perepelitsa
@ 2022-08-11 22:37   ` Zach Riggle
  2022-08-11 22:38     ` Zach Riggle
  0 siblings, 1 reply; 5+ messages in thread
From: Zach Riggle @ 2022-08-11 22:37 UTC (permalink / raw)
  To: Roman Perepelitsa; +Cc: Zsh Users

[-- Attachment #1: Type: text/plain, Size: 860 bytes --]

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@gmail.com> wrote:

> On Fri, Aug 5, 2022 at 6:37 PM Zach Riggle <zachriggle@gmail.com> 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.
>

[-- Attachment #2: Type: text/html, Size: 1857 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Weird expansion issue with (D)
  2022-08-11 22:37   ` Zach Riggle
@ 2022-08-11 22:38     ` Zach Riggle
  2022-08-11 22:42       ` Roman Perepelitsa
  0 siblings, 1 reply; 5+ messages in thread
From: Zach Riggle @ 2022-08-11 22:38 UTC (permalink / raw)
  To: Roman Perepelitsa; +Cc: Zsh Users

[-- Attachment #1: Type: text/plain, Size: 1163 bytes --]

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@gmail.com> 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@gmail.com> wrote:
>
>> On Fri, Aug 5, 2022 at 6:37 PM Zach Riggle <zachriggle@gmail.com> 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.
>>
>

[-- Attachment #2: Type: text/html, Size: 2551 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Weird expansion issue with (D)
  2022-08-11 22:38     ` Zach Riggle
@ 2022-08-11 22:42       ` Roman Perepelitsa
  0 siblings, 0 replies; 5+ messages in thread
From: Roman Perepelitsa @ 2022-08-11 22:42 UTC (permalink / raw)
  To: Zach Riggle; +Cc: Zsh Users

On Fri, Aug 12, 2022 at 12:38 AM Zach Riggle <zachriggle@gmail.com> wrote:
>
> Is there any way to mark a specific variable name to NOT be expanded in this way?

Nope.

Are you sure you need auto_name_dirs? Perhaps you can use regular
named directories instead? If not, what's your use case that requires
auto_name_dirs?

Roman.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-08-11 22:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-05 16:36 Weird expansion issue with (D) Zach Riggle
2022-08-05 16:54 ` Roman Perepelitsa
2022-08-11 22:37   ` Zach Riggle
2022-08-11 22:38     ` Zach Riggle
2022-08-11 22:42       ` Roman Perepelitsa

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).