apache/spark — pull request #109 by kellrott (2014-03-09 06:13:04+00:00)
Title: Ability to initialize Spark-Shell with command script

This script allows a user to define a script file with code that will be executed when then spark-shell starts up.
This initialization script file can be set either by setting the SPARK_SHELL_RC environmental variable to the path, or by placing a file at $HOME/.spark_shell_rc (the environmental variable takes precedence over the home directory file)

There are two main usage scenarios:
1) The user has a set of commands they want run automatically whenever they open spark-shell
2) Other software packages that depend on spark, and want to provide easy access to their code in a way similar to spark-shell, can provide a wrapper shell for spark-shell that adds the tool jars with ADD_JARS and then executes an initialization with SPARK_SHELL_RC to do all the import calls and variable initialization.