GitHub user kellrott opened a pull request: https://github.com/apache/spark/pull/109
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. You can merge this pull request into a Git repository by running: $ git pull https://github.com/kellrott/spark shell-rc Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/109.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #109 ---- commit 6432e0c30d3605498582313bd8728e7b9cc5413b Author: Kyle Ellrott <kellr...@gmail.com> Date: 2014-03-09T01:59:21Z Adding code to execute rc file at start of spark-shell. Either defined via environmental variable SPARKSHELL_RC or by file at $HOME/.spark_shell_rc commit 6a30cfdfe946017748620ae7fb89daa3a2dc5eae Author: Kyle Ellrott <kellr...@gmail.com> Date: 2014-03-09T05:02:29Z Changing SPARKSHELL_RC to SPARK_SHELL_RC ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---