"The elements in list can be repeated, can overlap, and can be specified
in any order, but the bytes, characters, or fields selected shall be
written in the order of the input data."
"The list option-arguments are historically used to select the portions
of the line to be written, but do not affect the order of the data. For
example:
echo abcdefghi | cut -c6,2,4-7,1
yields "abdefg"."
> But could we have
an additional option to respect the order of fields given on the command
line?
at which point, you have the choice between a POSIX-mandated solution
already on your system, even if you don't use coreutils; or waiting for
a coreutils extension to be written and propagate to your distro, and
which still won't work on other platforms like BSD. You can tell which
way we are leaning.
It is a pain to rearrange fields with sed, though of course it can
be done.
awk is better than sed for this task.
--
Eric Blake address@hidden +1-801-349-2682
Libvirt virtualization library http://libvirt.org