From owner-freebsd-current Sun Apr 22 16:26: 1 2001 Delivered-To: freebsd-current@freebsd.org Received: from Awfulhak.org (awfulhak.demon.co.uk [194.222.196.252]) by hub.freebsd.org (Postfix) with ESMTP id 0D7F737B42C; Sun, 22 Apr 2001 16:25:56 -0700 (PDT) (envelope-from brian@Awfulhak.org) Received: from hak.lan.Awfulhak.org (root@hak.lan.Awfulhak.org [172.16.0.12]) by Awfulhak.org (8.11.3/8.11.3) with ESMTP id f3MNR0b85860; Mon, 23 Apr 2001 00:27:00 +0100 (BST) (envelope-from brian@lan.Awfulhak.org) Received: from hak.lan.Awfulhak.org (brian@localhost [127.0.0.1]) by hak.lan.Awfulhak.org (8.11.3/8.11.3) with ESMTP id f3MNQKK02955; Mon, 23 Apr 2001 00:26:20 +0100 (BST) (envelope-from brian@hak.lan.Awfulhak.org) Message-Id: <200104222326.f3MNQKK02955@hak.lan.Awfulhak.org> X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: sobomax@FreeBSD.org Cc: brian@Awfulhak.org, kabaev@mail.ru, sheldonh@uunet.co.za, freebsd@gndrsh.dnsmgr.net, bsd@bsdhome.com, schweikh@schweikhardt.net, freebsd-current@FreeBSD.org, brian@Awfulhak.org Subject: Re: =?ISO-8859-1?Q?Re:_cp_-d_dir_patch_for_review_(or_'xargs'=3F)?= In-Reply-To: Message from Maxim Sobolev of "Sun, 22 Apr 2001 15:47:43 +0300." <200104221247.PAA94845@ipcard.iptcom.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 23 Apr 2001 00:26:20 +0100 From: Brian Somers Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > On Sun, 22 Apr 2001 13:16:31 +0100, Brian Somers wrote: > > > On Sat, 21 Apr 2001 20:04:31 +0100, Brian Somers wrote: > > > > > Sorry for butting in. Adding new non-portable functionality to solve the problem > > > > > which could be adequitely taken care of using existing and well known > > > > > techniquies is not appropriate, I completely agree with you on that. > > > > > > > > And I'm still waiting to see those well known techniques. > > > > > > Attached small script should solve this problem and doesn't require > > > introducing incompatible option in the standard tool. > > > > > > For example: > > > > > > find /usr/src -type f | xargs larg cp targetdir > > > > > > For speed purposes it could be implemented in raw C. > > > > > > -Maxim > > > > > > #!/bin/sh > > > > > > if [ ${#} -le 2 ]; then > > > echo "Usage: larg command lastarg arg1 [arg2 ...]" > > > exit 0 > > ^ > > oops :-) > > > fi > > > > > > COMMAND=${1} > > > LASTARG=${2} > > > shift 2 > > > exec ${COMMAND} "${@}" "${LASTARG}" > > > > Yes, I think this will work as long as your environment isn't > > polluted by something like $ENV (any increase in the environment size > > will effect xargs's calculation of how many arguments will fit on the > > command line). > > I don't see why it matters. The only thing that matters here is number of > args accepted by the shell. Anyway this is a 2-minute prototype... ;) > As you can see, the problem in fact could be easily solved using "well > known techniques". > > > Of course I still prefer the xargs fix - as you said above, it'd be > > nicer in C :-) > > I still don't see why it couldn't be an separate tool (perhaps more > general that my prototype). I don't see that such a tool would be used without xargs, whereas users of xargs often want/expect this sort of facility - or so I believe. > -Maxim -- Brian Don't _EVER_ lose your sense of humour ! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message