pan3793 commented on code in PR #49891:
URL: https://github.com/apache/spark/pull/49891#discussion_r1950964034


##########
dev/make-distribution.sh:
##########
@@ -317,9 +317,9 @@ if [ "$MAKE_TGZ" == "true" ]; then
     TARDIR="$SPARK_HOME/$TARDIR_NAME"
     rm -rf "$TARDIR"
     cp -r "$DISTDIR" "$TARDIR"
-    sed -i -e '$s/.*/export SPARK_CONNECT_MODE=1\n&/' "$TARDIR/bin/pyspark"
-    sed -i -e '$s/.*/export SPARK_CONNECT_MODE=1\n&/' "$TARDIR/bin/spark-shell"
-    sed -i -e '$s/.*/export SPARK_CONNECT_MODE=1\n&/' 
"$TARDIR/bin/spark-submit"
+    awk 'NR==1{print; print "export SPARK_CONNECT_MODE=1"; next} {print}' 
"$TARDIR/bin/pyspark" > temp.txt && mv temp.txt "$TARDIR/bin/pyspark"

Review Comment:
   BTW, awk/sed commands do not have good readability, leaving a brief comment 
is helpful



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to