Re: why does "cut" print fields in original order?

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

 



Robert P. J. Day wrote:
> On Wed, 21 Nov 2007, Frank Cox wrote:
> 
>> On Wed, 21 Nov 2007 01:44:26 -0500 (EST)
>> "Robert P. J. Day" <rpjday@xxxxxxxxxxxxxx> wrote:
>>
>>> i understand that that's not indicated on the man page.  on the
>>> other hand, is there any reason that it *wasn't* done that way?
>>> it would seem that that would be an obvious enhancement and,
>>> certainly, that would be more intuitive behaviour, no?
>> It would be fairly trivial to "roll your own" if you require that
>> functionality.
> 
> yes, i realize that -- i'm just baffled why that wasn't the obvious
> behaviour in the first place.  i mean, i'm trying to imagine the
> brainstorming session:
> 
> A:  "and if the user asks for fields 1 and 2, we'll print 1 and 2."
> B:  "yup, i'm all over that."
> A:  "and if he asks for 2 and 1 ... i know, we'll still print 1, then
>     2.  hahahaha!  oh, man, sometimes i crack me up!"
> 
> i'm just curious what kind of thinking went into doing something so
> non-intuitive.  after all, if you ask "awk" to print given fields, it
> does what you expect.  i just can't imagine what sort of thinking went
> into cut's behaviour, when doing it "right" the first time seems like
> it would have been a no-brainer.

I don't feel there is a concept of "right" in this case.

I mean, if you cut fields that have known meanings and retain the order you
still know the meaning of each field and you'd normally deal with them in
that order.  IMHO, it doesn't make much sense to cut them, rearrange them,
and then deal with them in an order different from the original order.

But, maybe that is just me.  When I deal with an ordered list in one area I
hope that the meaning/order of the list isn't changed in a different area.
Kind of makes keeping things straight difficult....

> anyway, i know there's always awk when i want something done
> correctly.

I think you mean, there is always a more flexible tool...such as awk.

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux