2222
2323cygwin=false
2424case " ` uname` " in
25- CYGWIN* ) cygwin=true;;
25+ CYGWIN* ) cygwin=true;;
2626esac
2727
2828# Enter posix mode for bash
@@ -32,9 +32,9 @@ set -o posix
3232FWDIR=" $( cd ` dirname $0 ` /..; pwd) "
3333
3434function usage() {
35- echo " Usage: ./bin/spark-shell [options]"
36- $FWDIR /bin/spark-submit --help 2>&1 | grep -v Usage 1>&2
37- exit 0
35+ echo " Usage: ./bin/spark-shell [options]"
36+ $FWDIR /bin/spark-submit --help 2>&1 | grep -v Usage 1>&2
37+ exit 0
3838}
3939
4040if [[ " $@ " = * --help ]] || [[ " $@ " = * -h ]]; then
@@ -46,20 +46,20 @@ SUBMIT_USAGE_FUNCTION=usage
4646gatherSparkSubmitOpts " $@ "
4747
4848function main() {
49- if $cygwin ; then
50- # Workaround for issue involving JLine and Cygwin
51- # (see http://sourceforge.net/p/jline/bugs/40/).
52- # If you're using the Mintty terminal emulator in Cygwin, may need to set the
53- # "Backspace sends ^H" setting in "Keys" section of the Mintty options
54- # (see https://github.com/sbt/sbt/issues/562).
55- stty -icanon min 1 -echo > /dev/null 2>&1
56- export SPARK_SUBMIT_OPTS=" $SPARK_SUBMIT_OPTS -Djline.terminal=unix"
57- $FWDIR /bin/spark-submit --class org.apache.spark.repl.Main " ${SUBMISSION_OPTS[@]} " spark-shell " ${APPLICATION_OPTS[@]} "
58- stty icanon echo > /dev/null 2>&1
59- else
60- export SPARK_SUBMIT_OPTS
61- $FWDIR /bin/spark-submit --class org.apache.spark.repl.Main " ${SUBMISSION_OPTS[@]} " spark-shell " ${APPLICATION_OPTS[@]} "
62- fi
49+ if $cygwin ; then
50+ # Workaround for issue involving JLine and Cygwin
51+ # (see http://sourceforge.net/p/jline/bugs/40/).
52+ # If you're using the Mintty terminal emulator in Cygwin, may need to set the
53+ # "Backspace sends ^H" setting in "Keys" section of the Mintty options
54+ # (see https://github.com/sbt/sbt/issues/562).
55+ stty -icanon min 1 -echo > /dev/null 2>&1
56+ export SPARK_SUBMIT_OPTS=" $SPARK_SUBMIT_OPTS -Djline.terminal=unix"
57+ $FWDIR /bin/spark-submit --class org.apache.spark.repl.Main " ${SUBMISSION_OPTS[@]} " spark-shell " ${APPLICATION_OPTS[@]} "
58+ stty icanon echo > /dev/null 2>&1
59+ else
60+ export SPARK_SUBMIT_OPTS
61+ $FWDIR /bin/spark-submit --class org.apache.spark.repl.Main " ${SUBMISSION_OPTS[@]} " spark-shell " ${APPLICATION_OPTS[@]} "
62+ fi
6363}
6464
6565# Copy restore-TTY-on-exit functions from Scala script so spark-shell exits properly even in
0 commit comments