Re: bash - sort command - can I sort by a certain field?
From: Alex Hunsley (lardattardisdoteddotacdotuk_at_mailinator.com)
Date: 12/02/04
- Next message: Ed Morton: "Re: how can awk read shell variable"
- Previous message: Alex Hunsley: "Re: bash - sort command - can I sort by a certain field?"
- In reply to: Alex Hunsley: "bash - sort command - can I sort by a certain field?"
- Next in thread: Michael Tosch: "Re: bash - sort command - can I sort by a certain field?"
- Reply: Michael Tosch: "Re: bash - sort command - can I sort by a certain field?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 02 Dec 2004 12:02:21 +0000
Alex Hunsley wrote:
> I'd like to use a bash command to sort a file by a certain field in that
> file.
> I've looked at sort but I can't see how to do it - interestingly, the
> docs say the -t option is for specifying a delimiter, but then I can't
> see anything else obvious about saying which field you'd like to sort by!
> If sort can't do this directly, I'm sure something is possible using cut
> + sort together, but the exact form eludes me at the moment!
>
> thanks
> alex
D'OH!
I've just discovered, via random web pages, that I can do:
sort +1 file.txt
... to sort by a certain field. My Cygwin man page says *nothing* about
this ability - why this oversight?
alex
- Next message: Ed Morton: "Re: how can awk read shell variable"
- Previous message: Alex Hunsley: "Re: bash - sort command - can I sort by a certain field?"
- In reply to: Alex Hunsley: "bash - sort command - can I sort by a certain field?"
- Next in thread: Michael Tosch: "Re: bash - sort command - can I sort by a certain field?"
- Reply: Michael Tosch: "Re: bash - sort command - can I sort by a certain field?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|