Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Setting GLOB_DOTS for a single command
- X-seq: zsh-users 27358
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zach Riggle <zachriggle@xxxxxxxxx>
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Setting GLOB_DOTS for a single command
- Date: Sat, 20 Nov 2021 21:36:03 -0800
- Archived-at: <https://zsh.org/users/27358>
- In-reply-to: <CAMP9c5mXzK=HHqZjwJdRSraf_LF3vLp0chMjpD-VnaurZ3z2Wg@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <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@xxxxxxxxx> 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
particular
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
shift
$c $~*
}
alias eglob="noglob eglob "
Messages sorted by:
Reverse Date,
Date,
Thread,
Author