bug-coreutils
[Top][All Lists]
Advanced

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

cut -f3,4 == -f4,3 throws away functionality


From: Dan Jacobson
Subject: cut -f3,4 == -f4,3 throws away functionality
Date: Sat, 14 Jun 2003 10:53:09 +0800
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-pc-linux-gnu)

Even though the cut man page says
       The  order of bytes, characters or fields in the output will be identi-
       cal to those in the input.  With no FILE, or when FILE is -, read stan-
       dard input.
But still I think
$ echo a,b,c,d|cut -d, -f 3,4
c,d
$ echo a,b,c,d|cut -d, -f 4,3
c,d

Is dumb.  Add another switch to do rearranging.  Yes,
awk -F, 'BEGIN{OFS=","};{print $4,$3}'
will work, but then of course the entire cut command could just be
made into a one line alias calling awk in the first place...
-- 
http://jidanni.org/ Taiwan(04)25854780




reply via email to

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