Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: xargs with zsh function
> On Jan 19, 2021, at 9:30 AM, Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
> 
> Perhaps this has something to do with the call in 'el' being to a clean shell? Same sort of problem if I do this:
> 
> $ ls (#i)c
> C  c
> 
> $ zsh -f
> h5--9-Debian1# ls (#i)c
> zsh: no matches found: (#i)c
> 
> ...  But that's bedrock syntax no?  How can the clean shell not swallow it?
Globbing flags require EXTENDED_GLOB, which is not enabled by default.
> Anyway I'd like zargs to work within my environment as it is.
To establish a known configuration, zargs resets nearly all zsh options for the duration of its execution. Your function should do likewise.
f() {
    emulate -L zsh
    setopt EXTENDED_GLOB
    [also any other options required]
    [...]
}
This ensures a known configuration that is isolated from that of the calling context.
vq
Sent from my iPhone
Messages sorted by:
Reverse Date,
Date,
Thread,
Author