help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zach Riggle <zachriggle@gmail.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: Setting GLOB_DOTS for a single command
Date: Sat, 20 Nov 2021 21:36:03 -0800	[thread overview]
Message-ID: <CAH+w=7YdXfs_f+GAUS0eTXLa7zUqrsWHbMG7vCqxtsNdX20qJg@mail.gmail.com> (raw)
In-Reply-To: <CAMP9c5mXzK=HHqZjwJdRSraf_LF3vLp0chMjpD-VnaurZ3z2Wg@mail.gmail.com>

Answering not the question in the subject, but the question in the
attempted approach:

On Sat, Nov 20, 2021 at 8:47 PM Zach Riggle <zachriggle@gmail.com> wrote:
> I expect that there's something I can do for scripts that I fully control, to declare some function ('globdots') which is invoked with noglob, and can then internally set the flag, and then trigger expansion of each argument in "$@".
> However, I'm not sure what portion of Section 14 (Expansion) to read to figure out how that works.

Since $@ is a parameter (one form of the array of all positional
parameters) you want to look at 14.3 Parameter Expansion.  In

As has been explained already, that's not necessary for globdots.
However, for various reasons, I prefer not to have extendedglob set
all the time, so I have this in my startup:

eglob() {
    setopt localoptions extendedglob
    local c=$1
    $c $~*
alias eglob="noglob eglob "

  parent reply	other threads:[~2021-11-21  5:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-21  4:46 Zach Riggle
2021-11-21  5:11 ` FW: " agkozak
2021-11-21  5:20   ` Bart Schaefer
2021-11-21  5:28 ` Lawrence Velázquez
2021-11-24  2:20   ` Zach Riggle
2021-11-21  5:36 ` Bart Schaefer [this message]
2021-11-21  5:38   ` Bart Schaefer

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:

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

  git send-email \
    --in-reply-to='CAH+w=7YdXfs_f+GAUS0eTXLa7zUqrsWHbMG7vCqxtsNdX20qJg@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=zachriggle@gmail.com \
    --cc=zsh-users@zsh.org \
    --subject='Re: Setting GLOB_DOTS for a single command' \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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


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).