4

The uniq(1) command can be viewed as a tiny map/reduce-style program:

  • map consecutive, identical input lines into groups;
  • reduce the list of lines (which are all identical) to a single line.

Are there more examples of programs in this (functional) style in Unix? And, if I would like to use another map or reduce function, are there more generic tools out there that let one provide custom mappers and reducers?

Maybe something like this:

mapreducer -mapper prog1 -reducer prog2 < input > output
dhag
  • 15,736
  • 4
  • 55
  • 65
miku
  • 673

1 Answers1

2

There's a tool out there called "bashreduce"

Article: http://www.linux-mag.com/id/7407/

GitHub: https://github.com/erikfrey/bashreduce