coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [coreutils] cut feature request


From: Bob Proulx
Subject: Re: [coreutils] cut feature request
Date: Tue, 7 Sep 2010 11:53:49 -0600
User-agent: Mutt/1.5.20 (2009-06-14)

Laurent Lyaudet wrote:
> it would be useful that cut handles negative numbers parameters for
> columns and fields as "from the end" parameters.
> ...
> I think using awk or something similar is overkill for solving that problem.

Why?  I think awk is the perfect tool for it.  It already handles the
problem well.  It is standard.

Awk:
  $ echo one two three | awk '{print$NF}'
  three

  $ echo one two three | awk '{print$(NF-1)}'
  two

Perl:
  $ echo one two three | perl -lane 'print $F[-1]'
  three

If cut included all of the features of awk (or perl) then cut would
also be overkill for the problem too, right?  Except then there
wouldn't be a way to avoid the bloat by using the small and light
weight cut, because cut wouldn't be small and light weight anymore,
right?

Meanwhile, I am not strongly opposed to this particular feature.  I am
strongly opposed to creeping featurism.

Bob



reply via email to

[Prev in Thread] Current Thread [Next in Thread]