[Let's keep the list in the loop]

On 11/08/2011 07:58 PM, 夏凯 wrote:
thanks for you reply.
if i want to get my result, whether should i use sort -u -k3 -k1 -k2 a
to do that?


I'm still not quite sure what result you want.

sort -u -k3 -k1 -k2 a

says to sort with three keys - from field 3 to the end of the line, from field 1 to the end of the line (aka the entire line), and from field 2 to the end of the line (that -k2 is useless, since sorting by field 1 to the end of the line already sorted everything so that there is no longer any distinguishing factors from field 2 to the end of the line). Then, after sorting, sort discards any lines where all three keys are identical, and since the -k1 key was the entire line, you are discarding only duplicate lines. But I don't know if that is what you wanted.

--
Eric Blake   [email protected]    +1-801-349-2682
Libvirt virtualization library http://libvirt.org



Reply via email to