Skip to content

Commit 03f3925

Browse files
committed
Merge #13510: Scripts and tools: Obsolete #!/bin/bash shebang
0000000 Obsolete #!/bin/bash shebang (DesWurstes) Pull request description: > `#!/bin/bash` assumes it is always installed to `/bin/` which can cause issues > `#!/usr/bin/env bash` searches the user's `PATH` to find the `bash` binary Details: https://github.com/dylanaraps/pure-bash-bible#obsolete-syntax I'm open to comments: Should I also fix `#!/bin/sh`? Tree-SHA512: b47bb4828116aa119f1899c68fee081270d51a898535490b9c616bf0f3660ad953f29c361eafc759bc64cdd54ee6eeecb2d79e9fdb5291a996a515c719805476
2 parents 31145a3 + 0000000 commit 03f3925

22 files changed

+28
-28
lines changed

contrib/devtools/gen-manpages.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
export LC_ALL=C
44
TOPDIR=${TOPDIR:-$(git rev-parse --show-toplevel)}

contrib/gitian-build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
# Copyright (c) 2016 The Bitcoin Core developers
33
# Distributed under the MIT software license, see the accompanying
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

contrib/gitian-descriptors/gitian-linux.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ script: |
5656
5757
function create_global_faketime_wrappers {
5858
for prog in ${FAKETIME_PROGS}; do
59-
echo '#!/bin/bash' > ${WRAP_DIR}/${prog}
59+
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${prog}
6060
echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog}
6161
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog}
6262
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${prog}
@@ -68,7 +68,7 @@ script: |
6868
function create_per-host_faketime_wrappers {
6969
for i in $HOSTS; do
7070
for prog in ${FAKETIME_HOST_PROGS}; do
71-
echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog}
71+
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${i}-${prog}
7272
echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
7373
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}
7474
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog}
@@ -98,7 +98,7 @@ script: |
9898
for prog in gcc g++; do
9999
rm -f ${WRAP_DIR}/${prog}
100100
cat << EOF > ${WRAP_DIR}/${prog}
101-
#!/bin/bash
101+
#!/usr/bin/env bash
102102
REAL="`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1`"
103103
for var in "\$@"
104104
do

contrib/gitian-descriptors/gitian-osx-signer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ script: |
1919
2020
# Create global faketime wrappers
2121
for prog in ${FAKETIME_PROGS}; do
22-
echo '#!/bin/bash' > ${WRAP_DIR}/${prog}
22+
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${prog}
2323
echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog}
2424
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog}
2525
echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${prog}

contrib/gitian-descriptors/gitian-osx.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ script: |
5555
5656
function create_global_faketime_wrappers {
5757
for prog in ${FAKETIME_PROGS}; do
58-
echo '#!/bin/bash' > ${WRAP_DIR}/${prog}
58+
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${prog}
5959
echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog}
6060
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog}
6161
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${prog}
@@ -67,7 +67,7 @@ script: |
6767
function create_per-host_faketime_wrappers {
6868
for i in $HOSTS; do
6969
for prog in ${FAKETIME_HOST_PROGS}; do
70-
echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog}
70+
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${i}-${prog}
7171
echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
7272
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}
7373
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog}

contrib/gitian-descriptors/gitian-win.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ script: |
4848
4949
function create_global_faketime_wrappers {
5050
for prog in ${FAKETIME_PROGS}; do
51-
echo '#!/bin/bash' > ${WRAP_DIR}/${prog}
51+
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${prog}
5252
echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog}
5353
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog}
5454
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${prog}
@@ -60,7 +60,7 @@ script: |
6060
function create_per-host_faketime_wrappers {
6161
for i in $HOSTS; do
6262
for prog in ${FAKETIME_HOST_PROGS}; do
63-
echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog}
63+
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${i}-${prog}
6464
echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
6565
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}
6666
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog}
@@ -76,14 +76,14 @@ script: |
7676
for i in $HOSTS; do
7777
mkdir -p ${WRAP_DIR}/${i}
7878
for prog in collect2; do
79-
echo '#!/bin/bash' > ${WRAP_DIR}/${i}/${prog}
79+
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${i}/${prog}
8080
REAL=$(${i}-gcc -print-prog-name=${prog})
8181
echo "export MALLOC_PERTURB_=255" >> ${WRAP_DIR}/${i}/${prog}
8282
echo "${REAL} \$@" >> $WRAP_DIR/${i}/${prog}
8383
chmod +x ${WRAP_DIR}/${i}/${prog}
8484
done
8585
for prog in gcc g++; do
86-
echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog}
86+
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${i}-${prog}
8787
echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
8888
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}
8989
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog}

contrib/init/bitcoind.init

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
#
33
# bitcoind The bitcoin core server.
44
#

contrib/macdeploy/extract-osx-sdk.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
# Copyright (c) 2016 The Bitcoin Core developers
33
# Distributed under the MIT software license, see the accompanying
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

contrib/verify-commits/pre-push-hook.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
# Copyright (c) 2014-2015 The Bitcoin Core developers
33
# Distributed under the MIT software license, see the accompanying
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

contrib/verifybinaries/verify.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
# Copyright (c) 2016 The Bitcoin Core developers
33
# Distributed under the MIT software license, see the accompanying
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

0 commit comments

Comments
 (0)