From efd9ef99bd7930b7910dcfe77adba52e8c3b652c Mon Sep 17 00:00:00 2001 From: huangxiaoping <1754789345@qq.com> Date: Tue, 11 Oct 2022 08:27:32 -0500 Subject: [PATCH] [SPARK-40735] Consistently invoke bash with /usr/bin/env bash in scripts to make code more portable ### What changes were proposed in this pull request? Consistently invoke bash with /usr/bin/env bash in scripts to make code more portable ### Why are the changes needed? some bash still use #!/bin/bash ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? no need test Closes #38191 from huangxiaopingRD/script. Authored-by: huangxiaoping <1754789345@qq.com> Signed-off-by: Sean Owen --- R/check-cran.sh | 2 +- R/create-docs.sh | 2 +- R/create-rd.sh | 2 +- R/find-r.sh | 2 +- R/install-dev.sh | 2 +- R/install-source-package.sh | 2 +- R/run-tests.sh | 2 +- bin/sparkR | 2 +- binder/postBuild | 2 +- connector/connect/dev/generate_protos.sh | 2 ++ connector/docker/build | 2 +- connector/docker/spark-test/build | 2 +- connector/docker/spark-test/master/default_cmd | 2 +- connector/docker/spark-test/worker/default_cmd | 2 +- core/src/test/scala/org/apache/spark/util/UtilsSuite.scala | 2 +- .../kubernetes/docker/src/main/dockerfiles/spark/entrypoint.sh | 2 +- sql/create-docs.sh | 2 +- 17 files changed, 18 insertions(+), 16 deletions(-) diff --git a/R/check-cran.sh b/R/check-cran.sh index 22c8f423cfd12..4123361f5e285 100755 --- a/R/check-cran.sh +++ b/R/check-cran.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/R/create-docs.sh b/R/create-docs.sh index 4867fd99e647c..3deaefd0659dc 100755 --- a/R/create-docs.sh +++ b/R/create-docs.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/R/create-rd.sh b/R/create-rd.sh index 72a932c175c95..1f0527458f2f0 100755 --- a/R/create-rd.sh +++ b/R/create-rd.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/R/find-r.sh b/R/find-r.sh index 690acc083af91..f1a5026911a7f 100755 --- a/R/find-r.sh +++ b/R/find-r.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/R/install-dev.sh b/R/install-dev.sh index 9fbc999f2e805..7df21c6c5ec9a 100755 --- a/R/install-dev.sh +++ b/R/install-dev.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/R/install-source-package.sh b/R/install-source-package.sh index 8de3569d1d482..0a2a5fe00f31f 100755 --- a/R/install-source-package.sh +++ b/R/install-source-package.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/R/run-tests.sh b/R/run-tests.sh index ca5b661127b53..90a60eda03871 100755 --- a/R/run-tests.sh +++ b/R/run-tests.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/bin/sparkR b/bin/sparkR index 29ab10df8ab6d..8ecc755839fe3 100755 --- a/bin/sparkR +++ b/bin/sparkR @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/binder/postBuild b/binder/postBuild index 733eafe175ef0..34ead09f692f9 100644 --- a/binder/postBuild +++ b/binder/postBuild @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/connector/connect/dev/generate_protos.sh b/connector/connect/dev/generate_protos.sh index 204beda6aa971..9457e7b33edd5 100755 --- a/connector/connect/dev/generate_protos.sh +++ b/connector/connect/dev/generate_protos.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with diff --git a/connector/docker/build b/connector/docker/build index 253a2fc8dd8e7..de83c7d7611dc 100755 --- a/connector/docker/build +++ b/connector/docker/build @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/connector/docker/spark-test/build b/connector/docker/spark-test/build index 6f9e19743370b..55dff4754b000 100755 --- a/connector/docker/spark-test/build +++ b/connector/docker/spark-test/build @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/connector/docker/spark-test/master/default_cmd b/connector/docker/spark-test/master/default_cmd index 96a36cd0bb682..6865ca41b894f 100755 --- a/connector/docker/spark-test/master/default_cmd +++ b/connector/docker/spark-test/master/default_cmd @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/connector/docker/spark-test/worker/default_cmd b/connector/docker/spark-test/worker/default_cmd index 2401f5565aa0b..1f2aac95ed699 100755 --- a/connector/docker/spark-test/worker/default_cmd +++ b/connector/docker/spark-test/worker/default_cmd @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Licensed to the Apache Software Foundation (ASF) under one or more diff --git a/core/src/test/scala/org/apache/spark/util/UtilsSuite.scala b/core/src/test/scala/org/apache/spark/util/UtilsSuite.scala index 3a1f0862e94e1..56fb5bf6c6cfe 100644 --- a/core/src/test/scala/org/apache/spark/util/UtilsSuite.scala +++ b/core/src/test/scala/org/apache/spark/util/UtilsSuite.scala @@ -1023,7 +1023,7 @@ class UtilsSuite extends SparkFunSuite with ResetSystemProperties { file.deleteOnExit() val cmd = s""" - |#!/bin/bash + |#!/usr/bin/env bash |trap "" SIGTERM |sleep 10 """.stripMargin diff --git a/resource-managers/kubernetes/docker/src/main/dockerfiles/spark/entrypoint.sh b/resource-managers/kubernetes/docker/src/main/dockerfiles/spark/entrypoint.sh index 5691011795dcf..780cfdfba8e9b 100755 --- a/resource-managers/kubernetes/docker/src/main/dockerfiles/spark/entrypoint.sh +++ b/resource-managers/kubernetes/docker/src/main/dockerfiles/spark/entrypoint.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with diff --git a/sql/create-docs.sh b/sql/create-docs.sh index 8721df874ee73..c5a36e0474eb0 100755 --- a/sql/create-docs.sh +++ b/sql/create-docs.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Licensed to the Apache Software Foundation (ASF) under one or more