All of lore.kernel.org
 help / color / mirror / Atom feed
* [kvm-unit-tests PATCH] Use /bin/env in shebang to make scripts more portable
@ 2017-03-15 10:25 Sergey Bronnikov
  2017-03-15 10:48 ` Peter Xu
  2017-03-16  7:38 ` Thomas Huth
  0 siblings, 2 replies; 10+ messages in thread
From: Sergey Bronnikov @ 2017-03-15 10:25 UTC (permalink / raw)
  To: kvm

Some operating systems installs bash executable file to other directory
than /bin. So it is better to use env utility to find bash.
---
 Makefile                | 2 +-
 arm/run                 | 2 +-
 configure               | 2 +-
 powerpc/run             | 2 +-
 run_tests.sh            | 2 +-
 scripts/mkstandalone.sh | 6 +++---
 x86/run                 | 2 +-
 7 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/Makefile b/Makefile
index 16ce297..2539f9a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 
-SHELL := /bin/bash
+SHELL := /usr/bin/env bash
 
 ifeq ($(wildcard config.mak),)
 $(error run ./configure first. See ./configure -h)
diff --git a/arm/run b/arm/run
index 2134c9e..0a9a3c8 100755
--- a/arm/run
+++ b/arm/run
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 if [ -z "$STANDALONE" ]; then
 	if [ ! -f config.mak ]; then
diff --git a/configure b/configure
index 8821f37..d152414 100755
--- a/configure
+++ b/configure
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 prefix=/usr/local
 cc=gcc
diff --git a/powerpc/run b/powerpc/run
index 6269abb..913bc5f 100755
--- a/powerpc/run
+++ b/powerpc/run
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 if [ -z "$STANDALONE" ]; then
 	if [ ! -f config.mak ]; then
diff --git a/run_tests.sh b/run_tests.sh
index 09cd057..7ac2526 100755
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 verbose="no"
 
diff --git a/scripts/mkstandalone.sh b/scripts/mkstandalone.sh
index 3c1938e..55cfc4e 100755
--- a/scripts/mkstandalone.sh
+++ b/scripts/mkstandalone.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 if [ ! -f config.mak ]; then
 	echo "run ./configure && make first. See ./configure -h"
@@ -38,7 +38,7 @@ generate_test ()
 {
 	local args=( $(escape "${@}") )
 
-	echo "#!/bin/bash"
+	echo "#!/usr/bin/env bash"
 	echo "export STANDALONE=yes"
 	echo "export HOST=\$(uname -m | sed -e 's/i.86/i386/;s/arm.*/arm/;s/ppc64.*/ppc64/')"
 	echo "export PRETTY_PRINT_STACKS=no"
@@ -65,7 +65,7 @@ generate_test ()
 	temp_file bin "$kernel"
 	args[3]='$bin'
 
-	(echo "#!/bin/bash"
+	(echo "#!/usr/bin/env bash"
 	 cat scripts/arch-run.bash "$TEST_DIR/run") | temp_file RUNTIME_arch_run
 
 	echo "exec {stdout}>&1"
diff --git a/x86/run b/x86/run
index 867a1cc..486a370 100755
--- a/x86/run
+++ b/x86/run
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 [ -z "$STANDALONE" ] && source scripts/arch-run.bash
 
-- 
2.10.1 (Apple Git-78)

^ permalink raw reply related	[flat|nested] 10+ messages in thread
* [kvm-unit-tests PATCH] Use /bin/env in shebang to make scripts more portable
@ 2017-03-15 11:12 Sergey Bronnikov
  0 siblings, 0 replies; 10+ messages in thread
From: Sergey Bronnikov @ 2017-03-15 11:12 UTC (permalink / raw)
  To: kvm

Some operating systems installs bash executable file to other directory
than /bin. So it is better to use env utility to find bash.

Signed-off-by: Sergey Bronnikov <sergeyb@bronevichok.ru>
---
 Makefile                | 2 +-
 arm/run                 | 2 +-
 configure               | 2 +-
 powerpc/run             | 2 +-
 run_tests.sh            | 2 +-
 scripts/mkstandalone.sh | 6 +++---
 x86/run                 | 2 +-
 7 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/Makefile b/Makefile
index 16ce297..2539f9a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 
-SHELL := /bin/bash
+SHELL := /usr/bin/env bash
 
 ifeq ($(wildcard config.mak),)
 $(error run ./configure first. See ./configure -h)
diff --git a/arm/run b/arm/run
index 2134c9e..0a9a3c8 100755
--- a/arm/run
+++ b/arm/run
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 if [ -z "$STANDALONE" ]; then
 	if [ ! -f config.mak ]; then
diff --git a/configure b/configure
index 8821f37..d152414 100755
--- a/configure
+++ b/configure
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 prefix=/usr/local
 cc=gcc
diff --git a/powerpc/run b/powerpc/run
index 6269abb..913bc5f 100755
--- a/powerpc/run
+++ b/powerpc/run
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 if [ -z "$STANDALONE" ]; then
 	if [ ! -f config.mak ]; then
diff --git a/run_tests.sh b/run_tests.sh
index 09cd057..7ac2526 100755
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 verbose="no"
 
diff --git a/scripts/mkstandalone.sh b/scripts/mkstandalone.sh
index 3c1938e..55cfc4e 100755
--- a/scripts/mkstandalone.sh
+++ b/scripts/mkstandalone.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 if [ ! -f config.mak ]; then
 	echo "run ./configure && make first. See ./configure -h"
@@ -38,7 +38,7 @@ generate_test ()
 {
 	local args=( $(escape "${@}") )
 
-	echo "#!/bin/bash"
+	echo "#!/usr/bin/env bash"
 	echo "export STANDALONE=yes"
 	echo "export HOST=\$(uname -m | sed -e 's/i.86/i386/;s/arm.*/arm/;s/ppc64.*/ppc64/')"
 	echo "export PRETTY_PRINT_STACKS=no"
@@ -65,7 +65,7 @@ generate_test ()
 	temp_file bin "$kernel"
 	args[3]='$bin'
 
-	(echo "#!/bin/bash"
+	(echo "#!/usr/bin/env bash"
 	 cat scripts/arch-run.bash "$TEST_DIR/run") | temp_file RUNTIME_arch_run
 
 	echo "exec {stdout}>&1"
diff --git a/x86/run b/x86/run
index 867a1cc..486a370 100755
--- a/x86/run
+++ b/x86/run
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 [ -z "$STANDALONE" ] && source scripts/arch-run.bash
 
-- 
2.10.1 (Apple Git-78)

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-03-17 12:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-15 10:25 [kvm-unit-tests PATCH] Use /bin/env in shebang to make scripts more portable Sergey Bronnikov
2017-03-15 10:48 ` Peter Xu
2017-03-15 12:31   ` Sergey Bronnikov
2017-03-16  7:38 ` Thomas Huth
2017-03-17  5:11   ` Sergey Bronnikov
2017-03-17  8:04     ` Thomas Huth
2017-03-17 11:11       ` Sergey Bronnikov
2017-03-17 11:18         ` Paolo Bonzini
2017-03-17 12:28         ` Thomas Huth
2017-03-15 11:12 Sergey Bronnikov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.