Skip to content

Commit 2ce741f

Browse files
author
Marcelo Vanzin
committed
Add lots of quotes.
Even to places that weren't really changes I made.
1 parent 3b28a75 commit 2ce741f

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed

bin/spark-class

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ fi
7777
CMD=()
7878
while IFS= read -d '' -r ARG; do
7979
CMD+=("$ARG")
80-
done < <($RUNNER -cp "$SPARK_LAUNCHER_CP" org.apache.spark.launcher.Main "$@")
80+
done < <("$RUNNER" -cp "$SPARK_LAUNCHER_CP" org.apache.spark.launcher.Main "$@")
8181

8282
if [ "${CMD[0]}" = "usage" ]; then
8383
"${CMD[@]}"

bin/spark-shell

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ export FWDIR="$(cd "`dirname "$0"`"/..; pwd)"
3232

3333
usage() {
3434
if [ -n "$1" ]; then
35-
echo $1
35+
echo "$1"
3636
fi
3737
echo "Usage: ./bin/spark-shell [options]"
3838
"$FWDIR"/bin/spark-submit --help 2>&1 | grep -v Usage 1>&2
39-
exit $2
39+
exit "$2"
4040
}
4141
export -f usage
4242

bin/spark-sql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export FWDIR="$(cd "`dirname "$0"`"/..; pwd)"
3232

3333
function usage {
3434
if [ -n "$1" ]; then
35-
echo $1
35+
echo "$1"
3636
fi
3737
echo "Usage: ./bin/spark-sql [options] [cli option]"
3838
pattern="usage"
@@ -45,13 +45,13 @@ function usage {
4545
"$FWDIR"/bin/spark-submit --help 2>&1 | grep -v Usage 1>&2
4646
echo
4747
echo "CLI options:"
48-
"$FWDIR"/bin/spark-class $CLASS --help 2>&1 | grep -v "$pattern" 1>&2
49-
exit $2
48+
"$FWDIR"/bin/spark-class "$CLASS" --help 2>&1 | grep -v "$pattern" 1>&2
49+
exit "$2"
5050
}
5151
export -f usage
5252

5353
if [[ "$@" = *--help ]] || [[ "$@" = *-h ]]; then
5454
usage "" 0
5555
fi
5656

57-
exec "$FWDIR"/bin/spark-submit --class $CLASS "$@"
57+
exec "$FWDIR"/bin/spark-submit --class "$CLASS" "$@"

bin/spark-submit

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ SPARK_HOME="$(cd "`dirname "$0"`"/..; pwd)"
2323
if ! type -t usage >/dev/null 2>&1; then
2424
usage() {
2525
if [ -n "$1" ]; then
26-
echo $1
26+
echo "$1"
2727
fi
2828
"$SPARK_HOME"/bin/spark-class org.apache.spark.deploy.SparkSubmit --help
29-
exit $2
29+
exit "$2"
3030
}
3131
export -f usage
3232
fi

sbin/spark-daemon.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,12 @@ if [ "$SPARK_NICENESS" = "" ]; then
122122
fi
123123

124124
run_command() {
125-
mode=$1
125+
mode="$1"
126126
shift
127127

128128
mkdir -p "$SPARK_PID_DIR"
129129

130-
if [ -f $pid ]; then
130+
if [ -f "$pid" ]; then
131131
TARGET_ID="$(cat "$pid")"
132132
if [[ $(ps -p "$TARGET_ID" -o args=) =~ $command ]]; then
133133
echo "$command running as process $TARGET_ID. Stop it first."
@@ -137,21 +137,21 @@ run_command() {
137137

138138
if [ "$SPARK_MASTER" != "" ]; then
139139
echo rsync from "$SPARK_MASTER"
140-
rsync -a -e ssh --delete --exclude=.svn --exclude='logs/*' --exclude='contrib/hod/logs/*' $SPARK_MASTER/ "$SPARK_HOME"
140+
rsync -a -e ssh --delete --exclude=.svn --exclude='logs/*' --exclude='contrib/hod/logs/*' "$SPARK_MASTER/" "$SPARK_HOME"
141141
fi
142142

143143
spark_rotate_log "$log"
144144
echo "starting $command, logging to $log"
145145

146-
case $mode in
146+
case "$mode" in
147147
(class)
148-
nohup nice -n $SPARK_NICENESS "$SPARK_PREFIX"/bin/spark-class $command "$@" >> "$log" 2>&1 < /dev/null &
149-
newpid=$!
148+
nohup nice -n "$SPARK_NICENESS" "$SPARK_PREFIX"/bin/spark-class $command "$@" >> "$log" 2>&1 < /dev/null &
149+
newpid="$!"
150150
;;
151151

152152
(submit)
153-
nohup nice -n $SPARK_NICENESS "$SPARK_PREFIX"/bin/spark-submit --class $command "$@" >> "$log" 2>&1 < /dev/null &
154-
newpid=$!
153+
nohup nice -n "$SPARK_NICENESS" "$SPARK_PREFIX"/bin/spark-submit --class $command "$@" >> "$log" 2>&1 < /dev/null &
154+
newpid="$!"
155155
;;
156156

157157
(*)
@@ -160,7 +160,7 @@ run_command() {
160160
;;
161161
esac
162162

163-
echo $newpid > $pid
163+
echo "$newpid" > "$pid"
164164
sleep 2
165165
# Check if the process has died; in that case we'll tail the log so the user can see
166166
if [[ ! $(ps -p "$newpid" -o args=) =~ $command ]]; then

0 commit comments

Comments
 (0)