From: Sergey Bronnikov <sergeyb@bronevichok.ru>
To: kvm@vger.kernel.org
Subject: [kvm-unit-tests PATCH] Use /bin/env in shebang to make scripts more portable
Date: Wed, 15 Mar 2017 13:25:50 +0300 [thread overview]
Message-ID: <20170315102550.GA44201@Sergeys-MacBook-Pro-2.local> (raw)
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)
next reply other threads:[~2017-03-15 10:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-15 10:25 Sergey Bronnikov [this message]
2017-03-15 10:48 ` [kvm-unit-tests PATCH] Use /bin/env in shebang to make scripts more portable 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
-- strict thread matches above, loose matches on Subject: below --
2017-03-15 11:12 Sergey Bronnikov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170315102550.GA44201@Sergeys-MacBook-Pro-2.local \
--to=sergeyb@bronevichok.ru \
--cc=kvm@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox