[buug] Sorting columns?

Jon McClintock jammer at weak.org
Sun Aug 3 16:21:35 PDT 2003


On Sun, Aug 03, 2003 at 12:33:38PM -0700, Claude Rubinson wrote:
> On Sun, Aug 03, 2003 at 12:16:44PM -0700, Jon McClintock wrote:
> > $ man 1 sort
> 
> I assume that you're referring to specifying a particular key column
> to sort by?  That doesn't do what I need.  Rather, I need to rejigger
> the actual columns (not sort by a particular column).  So, if my
> columns are currently:
> 
> foo bar baz
> 0   1   2
> 
> after sorting (alphabetically) they should be:
> 
> bar baz foo
> 1   2   0

Ah. In continued brevity, I shall demonstrate:

jammer at weak:~$ echo "foo bar" | awk '{print $2 " " $1}'
bar foo

-Jon "Off to Costco"



More information about the buug mailing list