Hello
I found that
echo "a,b,c" | cut -d"," -f1,2
gives the same result as
echo "a,b,c" | cut -d"," -f2,1
echo "a,b,c" | cut -d"," -f2,1
still gives
a,b
but
echo "a,b,c" | cut -d"," -f2,1 -p
gives
b,a
The current implementation of cut.c uses putchar so that a full line need not be held in memory, whereas holding a full line is required to re-order the fields rather than printing them from an input stream. This patch uses putchar when -p is not used, but it buffers a full line when -p is used.
What should I do next? I would like to have someone more experienced than I evaluate the changes so that I can improve them and add this functionality to coreutils.
Thank you
-Brad