sort(1) puzzle #1
(I’m waiting for a build to finish, so here’s a small Solaris sort
(1) trick.)
Question: I have the following data file
1401 8192 1401 3487 1401 0807 1305 3471 1305 6565 1408 2312 1408 1233
Using only sort
(1), how do I generate a file sorted by the first field, with only the highest valued second field for each first field value?
Note that the unique line behaviour of sort
(1) isn’t well specified, so versions from other platforms may not be able to do this trick.