From 7d157606ee0844491143969a492afe8aef882b98 Mon Sep 17 00:00:00 2001 From: Joe Harrison Date: Mon, 17 Feb 2020 23:49:29 +0000 Subject: [PATCH] Use /usr/bin/env in shebangs Stop assuming that bash is in /bin, and that perl and python are in /usr/bin, etc. Instead, use env command to find these commands in the path. --- client/gen_pm3mfsim_script.sh | 2 +- covbuild.sh | 2 +- covconfig.sh | 2 +- covsubmit.sh | 2 +- pm3 | 2 +- pm3-flash | 2 +- pm3-flash-all | 2 +- pm3-flash-bootrom | 2 +- pm3test.sh | 2 +- tools/analyzesize.py | 2 +- tools/findbits_test.py | 2 +- tools/hitag2crack/crack2/runtest.sh | 2 +- tools/jtag_openocd/openocd_flash_dump.sh | 2 +- tools/jtag_openocd/openocd_flash_recovery.sh | 2 +- tools/jtag_openocd/openocd_interactive.sh | 2 +- tools/mkversion.pl | 2 +- tools/pm3_amii_bin2eml.pl | 2 +- tools/pm3_cs8.pl | 2 +- tools/pm3_eml2lower.sh | 2 +- tools/pm3_eml2upper.sh | 2 +- tools/pm3_eml_mfd_test.py | 2 +- tools/rfidtest.pl | 2 +- tools/xorcheck.py | 2 +- 23 files changed, 23 insertions(+), 23 deletions(-) diff --git a/client/gen_pm3mfsim_script.sh b/client/gen_pm3mfsim_script.sh index 86f368673..73c7a4dd4 100644 --- a/client/gen_pm3mfsim_script.sh +++ b/client/gen_pm3mfsim_script.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Andrei Costin , 2011 # gen_pm3mfsim_script.sh diff --git a/covbuild.sh b/covbuild.sh index 1899cb8b3..2e18e677f 100755 --- a/covbuild.sh +++ b/covbuild.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e . .coverity.conf || exit 1 diff --git a/covconfig.sh b/covconfig.sh index 24815f200..b762ac6f1 100755 --- a/covconfig.sh +++ b/covconfig.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e . .coverity.conf || exit 1 diff --git a/covsubmit.sh b/covsubmit.sh index e39240954..61ca853f1 100755 --- a/covsubmit.sh +++ b/covsubmit.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e . .coverity.conf || exit 1 diff --git a/pm3 b/pm3 index d40fb0a91..e702e277f 100755 --- a/pm3 +++ b/pm3 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Usage: run option -h to get help diff --git a/pm3-flash b/pm3-flash index e5cd5479d..c5e920c24 100755 --- a/pm3-flash +++ b/pm3-flash @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash PM3PATH=$(dirname "$0") . "$PM3PATH/pm3" diff --git a/pm3-flash-all b/pm3-flash-all index e5cd5479d..c5e920c24 100755 --- a/pm3-flash-all +++ b/pm3-flash-all @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash PM3PATH=$(dirname "$0") . "$PM3PATH/pm3" diff --git a/pm3-flash-bootrom b/pm3-flash-bootrom index e5cd5479d..c5e920c24 100755 --- a/pm3-flash-bootrom +++ b/pm3-flash-bootrom @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash PM3PATH=$(dirname "$0") . "$PM3PATH/pm3" diff --git a/pm3test.sh b/pm3test.sh index de9134ba1..146650f71 100755 --- a/pm3test.sh +++ b/pm3test.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash PM3PATH=$(dirname "$0") cd "$PM3PATH" || exit 1 diff --git a/tools/analyzesize.py b/tools/analyzesize.py index 889222c01..965fe3d66 100755 --- a/tools/analyzesize.py +++ b/tools/analyzesize.py @@ -1,4 +1,4 @@ -#! /usr/bin/python3 +#! /usr/bin/env python3 import json import subprocess diff --git a/tools/findbits_test.py b/tools/findbits_test.py index db8dda8fa..d52334fd4 100644 --- a/tools/findbits_test.py +++ b/tools/findbits_test.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python from itertools import imap import unittest, sys, findbits diff --git a/tools/hitag2crack/crack2/runtest.sh b/tools/hitag2crack/crack2/runtest.sh index bcc08727c..2d9256d94 100755 --- a/tools/hitag2crack/crack2/runtest.sh +++ b/tools/hitag2crack/crack2/runtest.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash if [ "$1" == "" ]; then echo "runtest.sh testfile" diff --git a/tools/jtag_openocd/openocd_flash_dump.sh b/tools/jtag_openocd/openocd_flash_dump.sh index 650c218f1..4791b9112 100755 --- a/tools/jtag_openocd/openocd_flash_dump.sh +++ b/tools/jtag_openocd/openocd_flash_dump.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash cd $(dirname "$0") . openocd_configuration || exit 1 diff --git a/tools/jtag_openocd/openocd_flash_recovery.sh b/tools/jtag_openocd/openocd_flash_recovery.sh index 80caa08f0..490cf4abd 100755 --- a/tools/jtag_openocd/openocd_flash_recovery.sh +++ b/tools/jtag_openocd/openocd_flash_recovery.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash cd $(dirname "$0") . openocd_configuration || exit 1 diff --git a/tools/jtag_openocd/openocd_interactive.sh b/tools/jtag_openocd/openocd_interactive.sh index ac022f3f2..995ee6913 100755 --- a/tools/jtag_openocd/openocd_interactive.sh +++ b/tools/jtag_openocd/openocd_interactive.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash cd $(dirname "$0") . openocd_configuration || exit 1 diff --git a/tools/mkversion.pl b/tools/mkversion.pl index 997c2081b..95a794697 100644 --- a/tools/mkversion.pl +++ b/tools/mkversion.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl -w # Output a version.c file that includes information about the current build # Normally a couple of lines of bash would be enough (see openpcd project, original firmware by Harald Welte and Milosch Meriac) diff --git a/tools/pm3_amii_bin2eml.pl b/tools/pm3_amii_bin2eml.pl index bb16960d4..b042e1e73 100755 --- a/tools/pm3_amii_bin2eml.pl +++ b/tools/pm3_amii_bin2eml.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # # Read Amiibo data, decrypt, and produce EML file # Convert proxmark MFU (MIFARE Ultralight) .bin to .eml format diff --git a/tools/pm3_cs8.pl b/tools/pm3_cs8.pl index f1bfaf81d..888e7c360 100755 --- a/tools/pm3_cs8.pl +++ b/tools/pm3_cs8.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # # Convert proxmark3 trace or wav files to formats to be used by Inspectrum # diff --git a/tools/pm3_eml2lower.sh b/tools/pm3_eml2lower.sh index 086439c3c..b1c8d12f2 100755 --- a/tools/pm3_eml2lower.sh +++ b/tools/pm3_eml2lower.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Andrei Costin , 2011 # pm3_eml2lower.sh diff --git a/tools/pm3_eml2upper.sh b/tools/pm3_eml2upper.sh index 73b8646b7..bac3237cc 100755 --- a/tools/pm3_eml2upper.sh +++ b/tools/pm3_eml2upper.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Andrei Costin , 2011 # pm3_eml2upper.sh diff --git a/tools/pm3_eml_mfd_test.py b/tools/pm3_eml_mfd_test.py index 171bad843..4be66e83a 100755 --- a/tools/pm3_eml_mfd_test.py +++ b/tools/pm3_eml_mfd_test.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python from __future__ import with_statement from tempfile import mkdtemp diff --git a/tools/rfidtest.pl b/tools/rfidtest.pl index 304f59454..861f2a20a 100644 --- a/tools/rfidtest.pl +++ b/tools/rfidtest.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # -samy kamkar, rfid@samy.pl use strict; diff --git a/tools/xorcheck.py b/tools/xorcheck.py index 091998a31..04c031cf1 100755 --- a/tools/xorcheck.py +++ b/tools/xorcheck.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # xorcheck.py - find xor values for 8-bit LRC #