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
Generalization of uniq
uniq
There's a tool out there called bashreduce Article: http://www.linux-mag.com/id/7407/GitHub:https://github.com/erikfrey/bashreduce