1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
|
From 1e1414e99cfe5e2934b500015a3edfa358a849c6 Mon Sep 17 00:00:00 2001
From: Jakub Jirutka <jakub@jirutka.cz>
Date: Mon, 5 Feb 2018 20:30:05 +0100
Subject: [PATCH] fix bash shebang in scripts for better portability
Bash is not always installed in /bin! For example BSDs install Bash into
/usr/local/bin. Practically every *nix system has /usr/bin/env.
Upstream-Issue: https://github.com/ElektraInitiative/libelektra/pull/1810
---
doc/docker/buildelektra.sh | 2 +-
doc/vagrant/buildelektra.sh | 2 +-
scripts/benchmark-createtree | 2 +-
scripts/benchmark_augeas_hosts.sh | 2 +-
scripts/benchmark_libsplit.sh | 2 +-
scripts/build-homepage | 2 +-
scripts/check-env-dep | 2 +-
scripts/configure-firefox.in | 2 +-
scripts/convert-hosts | 2 +-
scripts/copy-template | 2 +-
scripts/elektra-merge | 2 +-
scripts/elektra-mount | 2 +-
scripts/elektra-umount | 2 +-
scripts/ffconfig/setupConfig | 2 +-
scripts/ffconfig/setupHomepage | 2 +-
scripts/ffconfig/setupProxy | 2 +-
scripts/fix-spelling | 2 +-
scripts/generate-seeds | 2 +-
scripts/install-sh-completion.in | 2 +-
scripts/kdb-bash-completion | 2 +-
scripts/metaini-to-c | 2 +-
tests/shell/shell_recorder/tutorial_wrapper/markdown_shell_recorder.sh | 2 +-
22 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/doc/docker/buildelektra.sh b/doc/docker/buildelektra.sh
index ed96e7955b..af54e4eacc 100755
--- a/doc/docker/buildelektra.sh
+++ b/doc/docker/buildelektra.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
set -o errexit
set -o pipefail
diff --git a/doc/vagrant/buildelektra.sh b/doc/vagrant/buildelektra.sh
index c7210148e6..1abbd6b35d 100755
--- a/doc/vagrant/buildelektra.sh
+++ b/doc/vagrant/buildelektra.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
set -o errexit
set -o pipefail
diff --git a/scripts/benchmark-createtree b/scripts/benchmark-createtree
index 56e9c1c584..34f29517ed 100755
--- a/scripts/benchmark-createtree
+++ b/scripts/benchmark-createtree
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# bash required for platform independent time
# $Id$
diff --git a/scripts/benchmark_augeas_hosts.sh b/scripts/benchmark_augeas_hosts.sh
index cd62e096a1..a7bca1087f 100755
--- a/scripts/benchmark_augeas_hosts.sh
+++ b/scripts/benchmark_augeas_hosts.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# bash required for platform independent time
if [ -z "$KDB" ]; then
diff --git a/scripts/benchmark_libsplit.sh b/scripts/benchmark_libsplit.sh
index d637f6ba4b..7dbc8daf2b 100755
--- a/scripts/benchmark_libsplit.sh
+++ b/scripts/benchmark_libsplit.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# bash required for platform independent time
if [ -z "$KDB" ]; then
diff --git a/scripts/build-homepage b/scripts/build-homepage
index 84eed66869..de605ca22f 100755
--- a/scripts/build-homepage
+++ b/scripts/build-homepage
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# This script is sourced on build server, shebang is for convenience
# bash is used to have a predictable ulimit behavior
diff --git a/scripts/check-env-dep b/scripts/check-env-dep
index ba9728e7a4..a6831647b6 100755
--- a/scripts/check-env-dep
+++ b/scripts/check-env-dep
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
OLD_IFS="$IFS"
IFS="$(printf '\n+')"
diff --git a/scripts/configure-firefox.in b/scripts/configure-firefox.in
index 4f8361b633..ab20f52914 100755
--- a/scripts/configure-firefox.in
+++ b/scripts/configure-firefox.in
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
SCRIPTS_DIR=$(dirname "$0")
. "${SCRIPTS_DIR}/configure-common"
diff --git a/scripts/convert-hosts b/scripts/convert-hosts
index 3f4ae9f158..a01c7d104c 100755
--- a/scripts/convert-hosts
+++ b/scripts/convert-hosts
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
########################################################################
##
diff --git a/scripts/copy-template b/scripts/copy-template
index d34627139c..316e13f9ca 100755
--- a/scripts/copy-template
+++ b/scripts/copy-template
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
#
# @author Markus Raab <elektra@markus-raab.org>
# @brief Creates a plugin out of the template plugin
diff --git a/scripts/elektra-merge b/scripts/elektra-merge
index ad367a25ac..70c024ea19 100755
--- a/scripts/elektra-merge
+++ b/scripts/elektra-merge
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
ours=$1
base=$2
diff --git a/scripts/elektra-mount b/scripts/elektra-mount
index 5872ad60d8..67c9bf59b0 100755
--- a/scripts/elektra-mount
+++ b/scripts/elektra-mount
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
help()
{
diff --git a/scripts/elektra-umount b/scripts/elektra-umount
index e958a62fc4..8ef1864d07 100755
--- a/scripts/elektra-umount
+++ b/scripts/elektra-umount
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
help()
{
diff --git a/scripts/ffconfig/setupConfig b/scripts/ffconfig/setupConfig
index eb0f14d0c9..9031323fe3 100755
--- a/scripts/ffconfig/setupConfig
+++ b/scripts/ffconfig/setupConfig
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# main script for guided preference setup used by configure-firefox
prefType=
diff --git a/scripts/ffconfig/setupHomepage b/scripts/ffconfig/setupHomepage
index ef63d9e133..0744bf63f2 100755
--- a/scripts/ffconfig/setupHomepage
+++ b/scripts/ffconfig/setupHomepage
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# guided setup for homepage preferences used by configure-firefox
diff --git a/scripts/ffconfig/setupProxy b/scripts/ffconfig/setupProxy
index 748be213c3..426366b001 100755
--- a/scripts/ffconfig/setupProxy
+++ b/scripts/ffconfig/setupProxy
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# guided setup for proxy preferences used by configure-firefox
diff --git a/scripts/fix-spelling b/scripts/fix-spelling
index acd1d44448..3bda9c11a7 100755
--- a/scripts/fix-spelling
+++ b/scripts/fix-spelling
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
#
# @author Markus Raab <elektra@markus-raab.org>
# @brief Fix spelling error in most files
diff --git a/scripts/generate-seeds b/scripts/generate-seeds
index b3b9cf7878..c38672bca4 100755
--- a/scripts/generate-seeds
+++ b/scripts/generate-seeds
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
#
# @author Kurt Micheli <kurt.micheli@libelektra.org>
# @brief generate uniformly distributed seeds with R
diff --git a/scripts/install-sh-completion.in b/scripts/install-sh-completion.in
index 36544d642f..bc29c5be31 100755
--- a/scripts/install-sh-completion.in
+++ b/scripts/install-sh-completion.in
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# This script will install the necessary configuration for zsh and bash completion
#
diff --git a/scripts/kdb-bash-completion b/scripts/kdb-bash-completion
index 039142f155..d4e5c2318b 100644
--- a/scripts/kdb-bash-completion
+++ b/scripts/kdb-bash-completion
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
###########################################################################
##
diff --git a/scripts/metaini-to-c b/scripts/metaini-to-c
index 79b812096a..df9c5f9742 100755
--- a/scripts/metaini-to-c
+++ b/scripts/metaini-to-c
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
if [ "$#" -ne 1 ];
then
diff --git a/tests/shell/shell_recorder/tutorial_wrapper/markdown_shell_recorder.sh b/tests/shell/shell_recorder/tutorial_wrapper/markdown_shell_recorder.sh
index fbe5a8e7a3..bb8ca8e793 100755
--- a/tests/shell/shell_recorder/tutorial_wrapper/markdown_shell_recorder.sh
+++ b/tests/shell/shell_recorder/tutorial_wrapper/markdown_shell_recorder.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
@INCLUDE_COMMON@
|