From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers <zsh-workers@sunsite.dk>
Subject: Re: zargs doesn't work reliably
Date: Fri, 18 Aug 2006 11:15:47 -0700 [thread overview]
Message-ID: <060818111547.ZM24340@torch.brasslantern.com> (raw)
In-Reply-To: <237967ef0608172016s4a47b309sd4a78f5889cfe2c7@mail.gmail.com>
In-Reply-To: <237967ef0608180612n3c57c588t6c75e7bf90c6eb5@mail.gmail.com>
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:
Options:
--eof[=eof-str], -e[eof-str]
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.
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.
next prev parent reply other threads:[~2006-08-18 18:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-17 22:59 Mikael Magnusson
2006-08-17 23:19 ` Nikolai Weibull
2006-08-18 2:42 ` Bart Schaefer
2006-08-18 3:16 ` Mikael Magnusson
2006-08-18 11:24 ` Vincent Lefevre
2006-08-18 13:12 ` Mikael Magnusson
2006-08-18 16:28 ` Vincent Lefevre
2006-08-18 18:15 ` Bart Schaefer [this message]
2006-08-18 23:44 ` Mikael Magnusson
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=060818111547.ZM24340@torch.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=zsh-workers@sunsite.dk \
/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).