From: Ray Andrews <rayandrews@eastlink.ca>
To: zsh-users@zsh.org
Subject: Re: xargs with zsh function
Date: Tue, 19 Jan 2021 06:30:53 -0800 [thread overview]
Message-ID: <7025ab43-7e15-df70-d09f-91ebaae2b7f2@eastlink.ca> (raw)
In-Reply-To: <6c7b3cb6-5c0d-e9ae-67ea-a194cf9f9181@eastlink.ca>
On 2021-01-18 9:18 p.m., Ray Andrews wrote:
I can't find any documentation of zargs which might help but behavior
seems mysterious:
#!/usr/bin/zsh
autoload zargs
xzargs() { zargs -n1 -t -- "${(f)$(read -d '' -E)}" -- "$@" }
typeset -g xinput=( 'mnt' 'rap' )
echo '\nfirst:'
eval "ls (#i)$xinput[1]"
eval "ls $xinput[2]"
function el ()
{
echo '\nin function:'
eval "ls (#i)$xinput[1]"
eval "ls $xinput[2]"
}
echo '\nsecond:'
eval "ls (#i)$xinput[1]"
eval "ls $xinput[2]"
print "$xinput" | xzargs el
echo '\nthird:'
eval "ls (#i)$xinput[1]"
eval "ls $xinput[2]"
-----------------------------------------------
Output:
My system as she lies:
$ . test
first:
mnt
rap
second:
mnt
rap
el mnt rap
in function:
(eval):1: no matches found: (#i)mnt
rap
third:
mnt
rap
-----------------------------------------------
Now from clean shell:
h5--9-Debian1# . test
first:
(eval):1: no matches found: (#i)mnt
rap
second:
(eval):1: no matches found: (#i)mnt
rap
el mnt rap
in function:
(eval):1: no matches found: (#i)mnt
rap
third:
(eval):1: no matches found: (#i)mnt
rap
-----------------------------------------------
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? Anyway I'd like zargs to work within my environment as it is.
next prev parent reply other threads:[~2021-01-19 14:31 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-17 23:12 Ray Andrews
2021-01-18 3:10 ` Bart Schaefer
2021-01-18 22:14 ` Ray Andrews
2021-01-18 23:09 ` Bart Schaefer
2021-01-19 5:18 ` Ray Andrews
2021-01-19 14:30 ` Ray Andrews [this message]
2021-01-19 17:52 ` Lawrence Velázquez
2021-01-19 20:27 ` Ray Andrews
2021-01-19 21:39 ` Bart Schaefer
2021-01-19 23:48 ` Ray Andrews
2021-01-20 1:05 ` Ray Andrews
2021-01-20 18:25 ` Ray Andrews
2021-01-21 5:52 ` Bart Schaefer
2021-01-21 19:55 ` Ray Andrews
2021-01-21 21:50 ` Bart Schaefer
2021-01-21 23:20 ` Ray Andrews
2021-01-19 20:31 ` Bart Schaefer
2021-01-19 20:59 ` Ray Andrews
2021-01-20 16:27 ` Daniel Shahaf
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=7025ab43-7e15-df70-d09f-91ebaae2b7f2@eastlink.ca \
--to=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).