[kvm-unit-tests PATCH] Use /bin/env in shebang to make scripts more portable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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)



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux