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: xargs with zsh function
Date: Thu, 21 Jan 2021 13:50:49 -0800	[thread overview]
Message-ID: <CAH+w=7b2Sd97SNKqOcBDfEK2EeF-JGPWQurn-aN8iwEcqQv0Qg@mail.gmail.com> (raw)
In-Reply-To: <31712f4b-1810-37ff-0dcd-3067055d1051@eastlink.ca>

On Thu, Jan 21, 2021 at 11:56 AM Ray Andrews <rayandrews@eastlink.ca> wrote:
>
> On 2021-01-20 9:52 p.m., Bart Schaefer wrote:
> >
> > Since Ray asked:  Apply this with
> >   patch -p1 Functions/Misc/zargs < zargs_patch2.txt
> Seems to pass my posted test with flying colors.  One thing tho, the
> paths:  My working 'zargs' is:
>
> ..../Zsh-5.8/share/zsh/5.8/functions/zargs
>
> I have no directory 'Functions' or 'Misc' anywhere on my system. How is
> it that my zsh directory tree is different?

My instruction was for patching the zsh source tree, not an installed location.

> BTW, speaking of passing data from one function to another supposing we
> have a list of filenames in a file:
>
> ... how can the contents of the file be fed to 'ls' as one call, but
> with the spaces protected?

That should "just work".  You don't usually even need zargs for that:

% ls -dl -- ${(f)"$(<filenames.txt)"}

The reason zargs exists is in case the above "ls" complains "argument
list too long".  In that case you can do

% zargs -- ${(f)"$(<filenames.txt)"} -- ls -dl

to break up the argument list into slices that "ls" will accept.


  reply	other threads:[~2021-01-21 21:51 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
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 [this message]
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='CAH+w=7b2Sd97SNKqOcBDfEK2EeF-JGPWQurn-aN8iwEcqQv0Qg@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).