Back to front pageView on Hacker News (opens in a new tab)Ask HN: What is the most beautiful piece of code you've ever read?476 pointsby seisvelas (on Hacker News)7 years agoPreferably an elegant snippet rather than an entire (well engineered) codebase.Comments (380) 116 threadsShow all commentsShowing thread 113 of 116known7 years ago#to count the unique lines from a file:cat animals.txt | awk '{ cnts[$0] += 1 } END { for (v in cnts) print cnts[v], v }'https://blog.jpalardy.com/posts/alternative-to-sort-uniq-c/
Ask HN: What is the most beautiful piece of code you've ever read?476 pointsby seisvelas (on Hacker News)7 years ago
known7 years ago#to count the unique lines from a file:cat animals.txt | awk '{ cnts[$0] += 1 } END { for (v in cnts) print cnts[v], v }'https://blog.jpalardy.com/posts/alternative-to-sort-uniq-c/
Comments (380) 116 threads
Show all comments
Showing thread 113 of 116
cat animals.txt | awk '{ cnts[$0] += 1 } END { for (v in cnts) print cnts[v], v }'
https://blog.jpalardy.com/posts/alternative-to-sort-uniq-c/