bug-coreutils
[Top][All Lists]
Advanced

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

bug#6394: Is it possible to reorder fields with cut?


From: Eric Blake
Subject: bug#6394: Is it possible to reorder fields with cut?
Date: Thu, 10 Jun 2010 11:44:29 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-3.fc13 Lightning/1.0b2pre Mnenhy/0.8.2 Thunderbird/3.0.4

On 06/10/2010 10:58 AM, Peng Yu wrote:
> Hi,
> 
> I need to reorder the fields in a file. But the -f option can not be
> used to reorder field 1 and field 2.

Correct.  POSIX standardized this behavior because some scripts rely on
it, even though it may not be the most intuitive.

> 
> Basically, I want the original 1st field as the new 2nd field and the
> original 2nd field the first. Is reordering fields possible with cut.

No.  Use awk instead.

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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