zsh-users
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: meino.cramer@gmx.de, Zsh Users <zsh-users@zsh.org>
Subject: Re: "ls" output like find ... -print0 anyhow ???
Date: Mon, 27 Jan 2014 04:49:37 +0100	[thread overview]
Message-ID: <CAHYJk3SUC4Uj4G_gw5os0Je=e4ZNHAGwxTq=V8EDSUThTUj7cw@mail.gmail.com> (raw)
In-Reply-To: <20140127015951.GA56068@redoubt.spodhuis.org>

On 27 January 2014 02:59, Phil Pennock
<zsh-workers+phil.pennock@spodhuis.org> wrote:
> On 2014-01-25 at 06:54 +0100, meino.cramer@gmx.de wrote:
>> is there a way to temporary convince 'ls' to act that way, that I can
>> use '| xargs -0' with it?
>>
>> Thank ypu very much in advance for any help!
>
> I'd use the print builtin of zsh, so that there are no argv length
> limitations, combined with zsh's very powerful glob operators.
>
>   print -N **/*.c(mM-1) | xargs -0 ...
>
> The `print -N` uses NUL characters between arguments, for compatibility
> with `xargs -0`, and the example glob finds all .c files anywhere under
> the current directory which were modified in the past month.
>
> -Phil

If you use the print builtin, make sure to also use -r to not do
backslash expansions.

-- 
Mikael Magnusson


  reply	other threads:[~2014-01-27  3:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-25  5:54 meino.cramer
2014-01-25 11:07 ` Han Pingtian
2014-01-25 11:51   ` Moritz Bunkus
2014-01-25 12:11 ` nyuszika7h
2014-01-25 12:13 ` Atom Smasher
2014-01-25 18:26 ` Bart Schaefer
2014-01-27  1:59 ` Phil Pennock
2014-01-27  3:49   ` Mikael Magnusson [this message]
2014-01-27  4:20   ` Bart Schaefer
2014-01-27  4:27     ` Kurtis Rader
2014-01-27 10:10     ` Atom Smasher

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='CAHYJk3SUC4Uj4G_gw5os0Je=e4ZNHAGwxTq=V8EDSUThTUj7cw@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=meino.cramer@gmx.de \
    --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).