Committer: Joseph Lorenzini <joseph.lorenzini@intel.com>

This is to address the issue raised in issue 28. Several shell scripts execute commands to run hadoop jobs. However, the shell script does not check the exit code after the command completes. This means the shell script could exit with a code of 0 even though the command failed. This makes it really difficult for a program that calls these scripts to determine whether the job completed successfully.

With this fix, when a hadoop jar is executed, the exit code is checked. If it is non-zero, then the script exits with a code of 1. I also added "set -u" to the top of each script so that if there is an uninitialized variable, the script will exit with a failure. I think this latter option is important since these scripts are intended to be edited by end users.

Note that I did not put the exit code checking in for kmeans/bin/prepare.sh. The reason for this is that hadoop command is being run through the built-in exec command. This means that anything after the script will enver be executed and thus would make exit code checking pointless. Since I don't understand why the exec is used, I left that script alone

Files to be changed:

	modified:   bayes/bin/prepare.sh
	modified:   bayes/bin/run.sh
	modified:   bayes/conf/configure.sh
	modified:   bin/hibench-config.sh
	modified:   bin/run-all.sh
	modified:   dfsioe/bin/prepare-read.sh
	modified:   dfsioe/bin/run-read.sh
	modified:   dfsioe/bin/run-write.sh
	modified:   dfsioe/conf/configure.sh
	modified:   hivebench/bin/prepare.sh
	modified:   hivebench/bin/run-aggregation.sh
	modified:   hivebench/bin/run-join.sh
	modified:   hivebench/conf/configure.sh
	modified:   kmeans/bin/prepare.sh
	modified:   kmeans/bin/run.sh
	modified:   kmeans/conf/configure.sh
	modified:   nutchindexing/bin/prepare.sh
	modified:   nutchindexing/bin/run.sh
	modified:   nutchindexing/conf/configure.sh
	modified:   pagerank/bin/prepare.sh
	modified:   pagerank/bin/run.sh
	modified:   pagerank/conf/configure.sh
	modified:   sort/bin/prepare.sh
	modified:   sort/bin/run.sh
	modified:   sort/conf/configure.sh
	modified:   terasort/bin/prepare.sh
	modified:   terasort/bin/run.sh
	modified:   wordcount/bin/prepare.sh
	modified:   wordcount/bin/run.sh
	modified:   wordcount/conf/configure.sh
When a script executes a hadoop job, the exit code is now checked. If the exit code is non-zero, then the script exits with a  code of 1. The change being committed here now has the shell script exiting with the code returned by the hadoop job.
fixed issue where the exit code was always going to return 0 in the shell scripts. Now hadoop command exit code is saved to a variable and that variable is the exit code used
moved the result variable right after the hadoop command. This ensures that correct exit code is captured.
Merge pull request #29 from jaloren/master

scripts should return whatever error code the commands it invokes return.