Zsh Mailing List Archive
Messages sorted by:
Re: zargs doesn't work reliably
- X-seq: zsh-workers 22625
- From: "Mikael Magnusson" <mikachu@xxxxxxxxx>
- To: zsh-workers <zsh-workers@xxxxxxxxxx>
- Subject: Re: zargs doesn't work reliably
- Date: Sat, 19 Aug 2006 01:44:02 +0200
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=M1AaD8D/KcVZx6UZRFj5sbEA/LWNUmnPVV2yL4I/qnGiZ+TOhhdXgUnED3l+CyfXDGemeWVAbM7VB+RShWZMWCHOonyddY3lydc/w834AyU388S/vr/FF/739nghCsOUnK/0Z0BAuuK5xQBwAuAjDt4iRiojsEslI6HeQuz6zLc=
- In-reply-to: <060818111547.ZM24340@xxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <237967ef0608171559k1bd8053bxf7a3d1cb53ef33e7@xxxxxxxxxxxxxx> <060817194225.ZM23196@xxxxxxxxxxxxxxxxxxxxxx> <237967ef0608172016s4a47b309sd4a78f5889cfe2c7@xxxxxxxxxxxxxx> <20060818112439.GC27421@xxxxxxxxxxxxx> <237967ef0608180612n3c57c588t6c75e7bf90c6eb5@xxxxxxxxxxxxxx> <060818111547.ZM24340@xxxxxxxxxxxxxxxxxxxxxx>
On 8/18/06, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
On Aug 17, 8:17pm, Mikael Magnusson wrote:
} > There are approximately eleventeen zillion unix/linux commands that
} > break given those file names, including rm, ls, and cp, so I'm not
} > going to get particularly worked up about zargs behaving similarly.
} % ls -l -- *
Yes, and you used an explicit "--" to tell ls that there might be "--"
in its argument list; it would have failed if you did not. The same
goes for "zargs -e".
} Would this be possible?
} zargs '[options]' 'command [initial-args]' [input-args]
I'm not going to agree with you about any scheme that breaks congruence
with the way xargs accepts its command and initial-args. The whole point
of zargs is to mimic xargs as closely as possible.
} Sorry, I should have looked in the manual. In my defense zargs --help
} was so helpful that i didn't suspect it left anything useful out and i
} did say i was tired :). Thanks for the pointers.
Thanks for the compliment about the help. It does say fairly early:
Change the end-of-input-args string from "--" to eof-str. If
given as --eof=, an empty argument is the end; as --eof or -e,
with no (or an empty) eof-str, all arguments are input-args.
After reading this a couple of times and trying some different
commands i came up with this working command:
% zargs --eof= -- * '' ls -d --
On Aug 18, 6:12am, Mikael Magnusson wrote:
} > What if you need an initial-arg that contains a space?
} I don't quite understand the question... zargs '' 'touch file\ with\
} spaces' /tmp/*
} or zargs '' 'touch "file with spaces"' /tmp/*
What if you have one initial-arg with a space, one with a backslash, one
with a single quote, and one with a double-quote?
The input-args already come to you "quoted" via the globbing mechansim.
It's much easier to pick something (including empty string, see the help
snippet above) that won't appear in the input-args than it is to quote
your way around oddities in the initial-args.
I didn't mean to sound like the current way is wrong and i have all
the answers, although it might have sounded a bit like that; i just
meant to make suggestions or ask if things would work that way.
Thanks again for your helpful help, and in the meantime i have another
question :). (->new thread)
Messages sorted by: