Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

9
  • 3
    Try sorting the output of printf %s\\n 111 10 2 22... first time use sort then sort -n (the latter meaning sort by arithmetic value) Commented Jul 30, 2017 at 20:02
  • @don_crissti But, my main source of confusion is when mixed character strings are used. How would you explain the difference in that case? Commented Jul 30, 2017 at 20:10
  • And how does the documentation make that distinction? It should be described in the documentation. Commented Jul 30, 2017 at 20:13
  • It's all in the info page... "An empty number is treated as ‘0’" and "Finally, as a last resort when all keys compare equal, ‘sort’ compares entire lines as if no ordering options other than ‘--reverse’ (‘-r’) were specified." so printf %s\\n b2 a3 | sort -n is the same as printf %s\\n 0b2 0a3 | sort Commented Jul 30, 2017 at 20:16
  • @don_crissti What is an empty number? Commented Jul 30, 2017 at 20:22