Source

go-wise / run-job.sh

#!/bin/bash
# Run Hadoop streaming job with mapper and reducer

# Input file/directory
in=/user/miki/alice.txt
# Output directory, deleted every time
out=/user/miki/words-out

# Delete output directory, outherwise our job will fail
hadoop fs -rmr $out > /dev/null 2>&1

# Run job
hadoop jar hadoop-streaming-0.20.2-cdh3u0.jar \
    -input $in \
    -output $out \
    -mapper mapper \
    -reducer reducer \
    -file mapper \
    -file reducer