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

From: Eric Blake <[email-masked]>
Date: Thu, 10 Jun 2010 11:44:29 -0600

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   [email-masked]    +1-801-349-2682
Libvirt virtualization library http://libvirt.org