bash - gusenov/kb GitHub Wiki

Wikipedia

LOLZ

Pipelines

Dr. Donald Knuth, the legendary computer scientist and Stanford University Professor was asked to write a program that:

  • Reads a text file and determines n frequently used words
  • Prints out a sorted list of words along with their frequencies

Knuth's solution was a ten-page Pascal program! Doug McIlroy realized the same with just the following shell script:

tr -cs A-Za-z ' n ' | tr A-Z a-z | sor t | uniq -c | sort -rn | sed ${1}q

So much for the power of command composition.