From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9815 invoked from network); 13 Aug 2005 01:41:10 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 13 Aug 2005 01:41:10 -0000 Received: (qmail 44983 invoked from network); 13 Aug 2005 01:41:04 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 13 Aug 2005 01:41:04 -0000 Received: (qmail 27849 invoked by alias); 13 Aug 2005 01:40:55 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9310 Received: (qmail 27838 invoked from network); 13 Aug 2005 01:40:55 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 13 Aug 2005 01:40:55 -0000 Received: (qmail 43736 invoked from network); 13 Aug 2005 01:40:55 -0000 Received: from vms040pub.verizon.net (206.46.252.40) by a.mx.sunsite.dk with SMTP; 13 Aug 2005 01:40:48 -0000 Received: from candle.brasslantern.com ([71.116.79.190]) by vms040.mailsrvcs.net (Sun Java System Messaging Server 6.2 HotFix 0.04 (built Dec 24 2004)) with ESMTPA id <0IL5004XU0NYFGO1@vms040.mailsrvcs.net> for zsh-users@sunsite.dk; Fri, 12 Aug 2005 20:40:47 -0500 (CDT) Received: from candle.brasslantern.com (IDENT:schaefer@localhost [127.0.0.1]) by candle.brasslantern.com (8.12.11/8.12.11) with ESMTP id j7D1ekBj013856 for ; Fri, 12 Aug 2005 18:40:46 -0700 Received: (from schaefer@localhost) by candle.brasslantern.com (8.12.11/8.12.11/Submit) id j7D1ekrH013855 for zsh-users@sunsite.dk; Fri, 12 Aug 2005 18:40:46 -0700 Date: Sat, 13 Aug 2005 01:40:46 +0000 From: Bart Schaefer Subject: Re: automatical xargs (or zargs) In-reply-to: <20050812202857.GE11840@ay.vinc17.org> To: zsh-users@sunsite.dk Message-id: <1050813014046.ZM13854@candle.brasslantern.com> MIME-version: 1.0 X-Mailer: Z-Mail (5.0.0 30July97) Content-type: text/plain; charset=us-ascii References: <20050812202857.GE11840@ay.vinc17.org> Comments: In reply to Vincent Lefevre "automatical xargs (or zargs)" (Aug 12, 10:28pm) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.4 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.