Re: sort by multiple columns not working
I'm not sure just what you are expecting, but it appears that sort is doing exactly what it is supposed to do.
Sort normally begins at the beginning (left) of the line and continues to the right until it encounters a difference. Once a difference is encountered, it sorts the difference and ignores the rest of the line.
The (key) argument causes sort to begin somewhere other than the beginning of the line. And optionally, a second (key) argument stops the sort before the end of the line.
Depending on what you are trying to accomplish, you might possibly achieve your goal by piping the output of sort into a second sort operation.
Break it, fix it, learn something.
People who never make mistakes seldom make anything!
Bookmarks