Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Dec 2008 18:39:49 -0500
From:      Mike Meyer <mwm-keyword-freebsdhackers2.e313df@mired.org>
To:        freebsd-hackers@freebsd.org
Subject:   Re: Small change to wc
Message-ID:  <20081205183949.6ee1d288@bhuda.mired.org>
In-Reply-To: <20081205231458.GY2038@deviant.kiev.zoral.com.ua>
References:  <f4ecc0930812051414n17867e1fi80d6ed458e879bde@mail.gmail.com> <7d6fde3d0812051448r1581d666v50d162cae348982a@mail.gmail.com> <f4ecc0930812051510v323ae95anccaca18d28fd174@mail.gmail.com> <20081205231458.GY2038@deviant.kiev.zoral.com.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 6 Dec 2008 01:14:58 +0200
Kostik Belousov <kostikbel@gmail.com> 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.

       <mike
-- 
Mike Meyer <mwm@mired.org>		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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20081205183949.6ee1d288>