From owner-freebsd-hackers@FreeBSD.ORG Fri Dec 5 23:40:17 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30C921065673 for ; Fri, 5 Dec 2008 23:40:17 +0000 (UTC) (envelope-from mwm-keyword-freebsdhackers2.e313df@mired.org) Received: from mired.org (five.mired.org [66.92.153.75]) by mx1.freebsd.org (Postfix) with ESMTP id B35E28FC17 for ; Fri, 5 Dec 2008 23:40:16 +0000 (UTC) (envelope-from mwm-keyword-freebsdhackers2.e313df@mired.org) Received: (qmail 8876 invoked by uid 1001); 5 Dec 2008 18:39:50 -0500 Received: from bhuda.mired.org (localhost.localdomain [127.0.0.1]) by bhuda (tmda-ofmipd) with ESMTP; Fri, 05 Dec 2008 18:39:49 -0500 Date: Fri, 5 Dec 2008 18:39:49 -0500 To: freebsd-hackers@freebsd.org Message-ID: <20081205183949.6ee1d288@bhuda.mired.org> In-Reply-To: <20081205231458.GY2038@deviant.kiev.zoral.com.ua> References: <7d6fde3d0812051448r1581d666v50d162cae348982a@mail.gmail.com> <20081205231458.GY2038@deviant.kiev.zoral.com.ua> Organization: Meyer Consulting X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.11; amd64-portbld-freebsd7.0) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAG1BMVEXguIzRkGnhyaz069mXhW0WHRnbrnR9WCQ6LB0CchNMAAACSUlEQVQ4jV2TQW7jMAxFGaPQOgQEdZaGMsgBrAvUA03dCxj1Uu4U2gfwQD7AGNax51NK07RcxXz6/CSl0Ij450vkPG1jzpIZM1UwDCl/xB14TWnNX8A00Qj5a0mnVFVbVUz4MeErea2HikSRqZzY894zwg9p2+/AtO8LzxFED+tNAUFeU29iFOLRxlZAcdo9A8wi8ZBMV4BKPde82Oxrvs6BTkulQIClte0DLFzzsKk9j1MBex8iUaP00Bd78S/muyFScrTXz6zLkEUxJp+SabQfNOs4f4Jpx5qSZ/304PWwlEWP1cOn/mJQR7EOD+uKhjcBLziuL7xoY5Xm+VFAUSw/LwwwsHEHxihpwV4EJH0xXRkbw1PkRw+X4pEuSJwBggqk+HEYKkiL5/74/nQkogigzQsAFrakxZyfw3wMIEEZPv4AWMfxwqE5GNxGaERjmH+PG8AE0L4/w9g0lsp1raLYAN5azQa+AOoO9NwcpFkTrG2VKNMNEL5UKUUAw34tha0z7onUG0oBoNtczE04GwFE3wCHc0ChezAJ6A1WMV81AtY7wDAJSlXwV+4cwBvsOsrQMRawfQEBz0deEZ7WNpV2szckIKo5VpDHDSDvF1GItwqqAlG01Hh50BGtVhuUkjkasg/14bYFGCgWg1fSWHvmOoJck2xdp9ZvZBHzDVTzX23TkrOn7qe5U2COEw5D4Vx3qEQpFY2Z/3QFnJxzp7YCmSMG19nOUoe869zZfOQb5ywQuWu0yCn5+8gxZz+BE7vG3j4/wbf4D/sXN9Wug1s7AAAAAElFTkSuQmCC Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Mike Meyer Subject: Re: Small change to wc X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2008 23:40:17 -0000 On Sat, 6 Dec 2008 01:14:58 +0200 Kostik Belousov wrote: > On Fri, Dec 05, 2008 at 03:10:56PM -0800, Sheldon Givens wrote: > > What's the problem having it? The total code is mere bytes and it eases the > > transition for others who are migrating from Linux. > > You're absolutely right in that it can be done with awk (fairly simply, too) > > but it doesn't hurt to explore options. Additionally, with awk, you can't > > get other figures with the same command, which increases ease of use. > > IE: What's the equivalent to "wc -clwL" in awk? Would you really rather run > > wc -clw && awk '{if(length>x){x=length}}END{if(x>0){print x}else{print > > 0}}'`? > > > > Isn't wc -L a more elegant solution than awk > > '{if(length>x){x=length}}END{if(x>0){print x}else{print 0}}'`? > > > > Should I continue? > > Real argument pro is that you have one less thing to worry when you > trying to run some script, written on Linux, on the FreeBSD system. Real argument con is that you're making life easier on users of GNU/Linux software whose authors ought to be taught how to write portable code. I think compatibility with GNU/Linux is a miserable reason for bloating software on BSD - especially considering how NU the typical GNU/Linux extensions are. However, this seems like a useful feature in and of itself, and fits in well with the command it's being added to. So adding it - and adding it to wc - seem like reasonable things. And if we're going to add a feature to a command, making it compatible with an existing implementation seems like a good idea. http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information. O< ascii ribbon campaign - stop html mail - www.asciiribbon.org