Github user nchammas commented on a diff in the pull request:
https://github.com/apache/spark/pull/3377#discussion_r22264776
--- Diff: bin/run-example ---
@@ -35,17 +35,29 @@ else
fi
if [ -f "$FWDIR/RELEASE" ]; then
- export SPARK_EXAMPLES_JAR="`ls "$FWDIR"/lib/spark-examples-*hadoop*.jar`"
-elif [ -e
"$EXAMPLES_DIR"/target/scala-$SPARK_SCALA_VERSION/spark-examples-*hadoop*.jar
]; then
- export SPARK_EXAMPLES_JAR="`ls
"$EXAMPLES_DIR"/target/scala-$SPARK_SCALA_VERSION/spark-examples-*hadoop*.jar`"
+ JAR_PATH="${FWDIR}/lib"
+else
+ JAR_PATH="${EXAMPLES_DIR}/target/scala-${SPARK_SCALA_VERSION}"
fi
-if [[ -z "$SPARK_EXAMPLES_JAR" ]]; then
+JAR_COUNT="`ls ${JAR_PATH}/spark-examples-*hadoop*.jar 2>>/dev/null | wc
-l`"
--- End diff --
I know that the old code used this style, but it would be great if we could
replace all occurrences where we capture the output of `ls` with one of the
recommended patterns in either of [these](http://mywiki.wooledge.org/ParsingLs)
[two](http://www.dwheeler.com/essays/filenames-in-shell.html) pages (e.g. using
`for f in glob_expression` or using `find`).
Even better would be to find a way to avoid having to capture this output
at all
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]