zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Ray Andrews <rayandrews@eastlink.ca>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: tilde syntax
Date: Thu, 4 Jan 2024 14:49:08 -0800	[thread overview]
Message-ID: <CAH+w=7ZS74YyODpjK-LpLnoUoc3=mUCAV84kN77K+UfHvbLkiQ@mail.gmail.com> (raw)
In-Reply-To: <625e7ef5-be1f-4b5d-bb2a-f71634d151cf@eastlink.ca>

On Thu, Jan 4, 2024 at 2:32 PM Ray Andrews <rayandrews@eastlink.ca> wrote:
>
>      subdirs=( $~zsh_case$1*(/N) ) # This works: but tilde must follow
> first dollar sign
>
> [...] what does the tilde really do?

Results of parameter expansion by default (in native zsh emulation)
are not subject to further interpretation.  The tilde says that it's
OK to interpret the result as part of a pattern (globbing or string
comparison, depending on context).

> The tilde turns globing into pattern matching, yes?

No, it turns "do nothing else" into "also act as a glob or pattern".
In this example, it's a glob.

> But '(#i)' works if literal, it's not mistaken for a glob pattern

What do you mean by "works"?  With extendeglob set, it IS a (glob)
pattern, it's the pattern than means "the rest of this pattern is case
insensitive".


  reply	other threads:[~2024-01-04 22:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-04 22:31 Ray Andrews
2024-01-04 22:49 ` Bart Schaefer [this message]
2024-01-04 23:04   ` Ray Andrews
2024-01-04 23:40     ` Lawrence Velázquez
2024-01-05  0:12       ` Ray Andrews
2024-01-05  1:41         ` Lawrence Velázquez
2024-01-05  2:03           ` Ray Andrews
2024-01-05 14:41             ` Mark J. Reed
2024-01-05 16:42               ` Ray Andrews
2024-01-05 19:58                 ` Bart Schaefer
2024-01-05 22:50                   ` Ray Andrews
2024-01-05 23:27                     ` Bart Schaefer
2024-01-05 23:47                       ` Ray Andrews
2024-01-06  0:23                         ` Bart Schaefer
2024-01-06  3:44                           ` Ray Andrews

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH+w=7ZS74YyODpjK-LpLnoUoc3=mUCAV84kN77K+UfHvbLkiQ@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=rayandrews@eastlink.ca \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).