* automatical xargs (or zargs)
@ 2005-08-12 20:28 Vincent Lefevre
2005-08-13 1:40 ` Bart Schaefer
0 siblings, 1 reply; 2+ messages in thread
From: Vincent Lefevre @ 2005-08-12 20:28 UTC (permalink / raw)
To: zsh-users
Is there a way to do the following?
When globbing generates a line that is "too long" (configurable
by the user), the command is automatically replaced by one using
xargs or zargs.
--
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: automatical xargs (or zargs)
2005-08-12 20:28 automatical xargs (or zargs) Vincent Lefevre
@ 2005-08-13 1:40 ` Bart Schaefer
0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2005-08-13 1:40 UTC (permalink / raw)
To: zsh-users
On Aug 12, 10:28pm, Vincent Lefevre wrote:
}
} Is there a way to do the following?
Not in the general case, no.
} When globbing generates a line that is "too long" (configurable
} by the user), the command is automatically replaced by one using
} xargs or zargs.
There's no hook that's available after globbing has occurred but
before the command execution is attempted. There's also no hook
that's available "between" commands in a pipeline, or in a compound
command line using semicolons, or in a structured loop body. So
the closest you can come is, in an interactive shell, to override
the ZLE accept-line function, parse $BUFFER yourself, perform the
expansions, test the lengths, and reassign a rewritten BUFFER before
the line is really accepted.
This is almost certainly a lot more work than the result is worth,
and there's absolutely nothing you can do in a non-interactive
situation such as a script.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-08-13 1:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-12 20:28 automatical xargs (or zargs) Vincent Lefevre
2005-08-13 1:40 ` Bart Schaefer
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).