bash map reduce in bash and python