FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 11-21-2007, 05:30 AM
"Robert P. J. Day"
 
Default why does "cut" print fields in original order?

nitpicky, yes, but it occasionally irritates me that "cut" will
print fields, not in the order you specify them with the "-f" option,
but in the original order in the source text, to wit:

$ cut -d: -f1,7 /etc/passwd
root:/bin/bash
bin:/sbin/nologin
daemon:/sbin/nologin
...

$ cut -fd: -f7,1 /etc/passwd
root:/bin/bash
bin:/sbin/nologin
daemon:/sbin/nologin
...

is there really a reason that cut refuses to acknowledge the order
of the fields as supplied by the user? some historical reason,
perhaps, that we can now all make fun of and wonder what they were
smoking at the time?

rday

================================================== ======================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://crashcourse.ca
================================================== ======================

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 11-21-2007, 05:39 AM
Ed Greshko
 
Default why does "cut" print fields in original order?

Robert P. J. Day wrote:
> nitpicky, yes, but it occasionally irritates me that "cut" will
> print fields, not in the order you specify them with the "-f" option,
> but in the original order in the source text, to wit:
>
> $ cut -d: -f1,7 /etc/passwd
> root:/bin/bash
> bin:/sbin/nologin
> daemon:/sbin/nologin
> ...
>
> $ cut -fd: -f7,1 /etc/passwd
> root:/bin/bash
> bin:/sbin/nologin
> daemon:/sbin/nologin
> ...
>
> is there really a reason that cut refuses to acknowledge the order
> of the fields as supplied by the user? some historical reason,
> perhaps, that we can now all make fun of and wonder what they were
> smoking at the time?

I don't see any indication from the man page that would lead one to believe
that cut will print in the order listed. I think you are simply implying a
behavior that was never intended.

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 

Thread Tools




All times are GMT. The time now is 07:57 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org