From 5e550c455818bbc9b625c4c610fa7427115921de Mon Sep 17 00:00:00 2001 From: Richard Marko Date: Mon, 4 Dec 2023 10:55:08 +0100 Subject: [PATCH] treewide: fix shebangs - /bin/bash -> /usr/bin/env bash Most scripts/tools use non-portable `/bin/bash`, switch to environment agnostic `/usr/bin/env bash`. --- ArduPlane/createTags | 2 +- Rover/createTags | 2 +- Tools/Linux_HAL_Essentials/pru/aiopru/start_test | 2 +- Tools/Linux_HAL_Essentials/startup.sh | 2 +- Tools/Replay/plotit.sh | 2 +- Tools/UDP_Proxy/start_proxies.sh | 2 +- Tools/autotest/run_in_terminal_window.sh | 2 +- Tools/debug/gdb_crashdump.sh | 2 +- Tools/environment_install/APM_install.sh | 2 +- Tools/environment_install/install-ROS-ubuntu.sh | 2 +- Tools/environment_install/install-prereqs-arch.sh | 2 +- Tools/environment_install/install-prereqs-mac.sh | 4 ++-- Tools/environment_install/install-prereqs-ubuntu.sh | 2 +- Tools/environment_install/ubuntu-18.04-python3.sh | 2 +- Tools/geotag/geotag.sh | 2 +- Tools/gittools/git-commit-subsystems | 2 +- Tools/gittools/git-subsystems-split | 2 +- Tools/gittools/path-libraries.sh | 2 +- Tools/gittools/path-nonlibraries.sh | 2 +- Tools/scripts/CAN/can_sitl.sh | 2 +- Tools/scripts/CAN/can_sitl_nodev.sh | 2 +- Tools/scripts/build-jsbsim.sh | 2 +- Tools/scripts/build_all.sh | 2 +- Tools/scripts/build_appveyor.sh | 2 +- Tools/scripts/build_autotest.sh | 2 +- Tools/scripts/build_ci.sh | 2 +- Tools/scripts/build_docs.sh | 2 +- Tools/scripts/build_examples.sh | 2 +- Tools/scripts/build_log_message_documentation.sh | 2 +- Tools/scripts/build_parameters.sh | 2 +- Tools/scripts/configure-ci.sh | 2 +- Tools/scripts/cygwin_build.sh | 2 +- Tools/scripts/esp32_get_idf.sh | 5 ++--- Tools/scripts/fix_libraries_includes.sh | 2 +- Tools/scripts/format.sh | 2 +- Tools/scripts/macos_remote_upload.sh | 2 +- Tools/scripts/run_luacheck.sh | 2 +- Tools/scripts/unpack_mp.sh | 2 +- Tools/vagrant/initvagrant-desktop.sh | 2 +- Tools/vagrant/initvagrant-trusty64.sh | 2 +- Tools/vagrant/initvagrant.sh | 2 +- docs/build-apmrover2.sh | 2 +- docs/build-arducopter.sh | 2 +- docs/build-arduplane.sh | 2 +- docs/build-ardusub.sh | 2 +- docs/build-libs.sh | 2 +- .../AP_Motors/examples/AP_Motors_test/MotorTestSweep.sh | 2 +- .../AP_Scripting/applets/Aerobatics/FixedWing/dual_plane.sh | 2 +- libraries/SITL/examples/Airsim/follow-copter.sh | 2 +- libraries/SITL/examples/Airsim/multi_vehicle.sh | 2 +- libraries/SITL/examples/Follow/plane_quad.sh | 2 +- libraries/SITL/examples/Morse/start_follow.sh | 2 +- libraries/SITL/examples/Webots/dronePlus.sh | 2 +- libraries/SITL/examples/Webots/droneTricopter.sh | 2 +- libraries/SITL/examples/Webots/droneTwoTricopters.sh | 2 +- libraries/SITL/examples/Webots/droneX.sh | 2 +- libraries/SITL/examples/Webots/droneX_TwoDrones.sh | 2 +- libraries/SITL/examples/Webots/pyramids_droneX.sh | 2 +- libraries/SITL/examples/Webots/pyramids_droneX_twoDrones.sh | 2 +- libraries/SITL/examples/Webots/rover.sh | 2 +- libraries/SITL/examples/follow-copter.sh | 2 +- libraries/SITL/examples/follow-mavproxy.sh | 2 +- libraries/doc/updateDocs | 2 +- 63 files changed, 65 insertions(+), 66 deletions(-) diff --git a/ArduPlane/createTags b/ArduPlane/createTags index e13937801d6ec..df38cc23ca6ad 100755 --- a/ArduPlane/createTags +++ b/ArduPlane/createTags @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash #" Autocompletion enabled vim for arduino pde's ctags -RV --language-force=C++ --c++-kinds=+p --fields=+iaS --extra=+q \ diff --git a/Rover/createTags b/Rover/createTags index e13937801d6ec..df38cc23ca6ad 100755 --- a/Rover/createTags +++ b/Rover/createTags @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash #" Autocompletion enabled vim for arduino pde's ctags -RV --language-force=C++ --c++-kinds=+p --fields=+iaS --extra=+q \ diff --git a/Tools/Linux_HAL_Essentials/pru/aiopru/start_test b/Tools/Linux_HAL_Essentials/pru/aiopru/start_test index 437e267d03d40..162ab16d1261c 100755 --- a/Tools/Linux_HAL_Essentials/pru/aiopru/start_test +++ b/Tools/Linux_HAL_Essentials/pru/aiopru/start_test @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash #make debug #make test if [ ! -L /sys/class/gpio/gpio80 ] || [ ! -e /sys/class/gpio/gpio80 ] ; then diff --git a/Tools/Linux_HAL_Essentials/startup.sh b/Tools/Linux_HAL_Essentials/startup.sh index 82b3847f87fc7..b5fd5f0607140 100755 --- a/Tools/Linux_HAL_Essentials/startup.sh +++ b/Tools/Linux_HAL_Essentials/startup.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash if [ "`echo $1`" = "load" ]; then echo "Loading Test_Capes..." diff --git a/Tools/Replay/plotit.sh b/Tools/Replay/plotit.sh index 59a2fea56f20d..68bd9f1c7e6bf 100755 --- a/Tools/Replay/plotit.sh +++ b/Tools/Replay/plotit.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash cmd="plot " echo $# diff --git a/Tools/UDP_Proxy/start_proxies.sh b/Tools/UDP_Proxy/start_proxies.sh index 4763d0cd92182..3e8ef97671b6b 100755 --- a/Tools/UDP_Proxy/start_proxies.sh +++ b/Tools/UDP_Proxy/start_proxies.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # an example script that starts udpproxy for multiple ports under GNU # screen, allowing for unattended operation of the proxy for long # periods diff --git a/Tools/autotest/run_in_terminal_window.sh b/Tools/autotest/run_in_terminal_window.sh index 7a83f1c565dac..ac5c8e792dbca 100755 --- a/Tools/autotest/run_in_terminal_window.sh +++ b/Tools/autotest/run_in_terminal_window.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Try to run a command in an appropriate type of terminal window # depending on whats available diff --git a/Tools/debug/gdb_crashdump.sh b/Tools/debug/gdb_crashdump.sh index 89f6b4d66c160..917ffa75033fb 100755 --- a/Tools/debug/gdb_crashdump.sh +++ b/Tools/debug/gdb_crashdump.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # script to more easily get a backtrace from an ArduPilot crash_dump.bin diff --git a/Tools/environment_install/APM_install.sh b/Tools/environment_install/APM_install.sh index acb7a1fbae944..869687dbff017 100755 --- a/Tools/environment_install/APM_install.sh +++ b/Tools/environment_install/APM_install.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash #A simple script to install the APM SITL environment into cygwin diff --git a/Tools/environment_install/install-ROS-ubuntu.sh b/Tools/environment_install/install-ROS-ubuntu.sh index 565670f5a502b..435560ac4f0ab 100755 --- a/Tools/environment_install/install-ROS-ubuntu.sh +++ b/Tools/environment_install/install-ROS-ubuntu.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash echo "---------- $0 start ----------" set -e # set -x diff --git a/Tools/environment_install/install-prereqs-arch.sh b/Tools/environment_install/install-prereqs-arch.sh index 52b94eca23cd6..965815ec71efc 100755 --- a/Tools/environment_install/install-prereqs-arch.sh +++ b/Tools/environment_install/install-prereqs-arch.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e set -x diff --git a/Tools/environment_install/install-prereqs-mac.sh b/Tools/environment_install/install-prereqs-mac.sh index 6486b007d6452..de2cd666ef760 100755 --- a/Tools/environment_install/install-prereqs-mac.sh +++ b/Tools/environment_install/install-prereqs-mac.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash echo "---------- $0 start ----------" set -e set -x @@ -42,7 +42,7 @@ echo "Checking homebrew..." $(which -s brew) || { echo "installing homebrew..." - /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + /usr/bin/env bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" } echo "Homebrew installed" diff --git a/Tools/environment_install/install-prereqs-ubuntu.sh b/Tools/environment_install/install-prereqs-ubuntu.sh index 594aa33708e45..0107c24a33e11 100755 --- a/Tools/environment_install/install-prereqs-ubuntu.sh +++ b/Tools/environment_install/install-prereqs-ubuntu.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash echo "---------- $0 start ----------" set -e set -x diff --git a/Tools/environment_install/ubuntu-18.04-python3.sh b/Tools/environment_install/ubuntu-18.04-python3.sh index a82a4138a4c73..1b0df324fddcf 100755 --- a/Tools/environment_install/ubuntu-18.04-python3.sh +++ b/Tools/environment_install/ubuntu-18.04-python3.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e set -x diff --git a/Tools/geotag/geotag.sh b/Tools/geotag/geotag.sh index 58703fd43c6b7..02b30342560bf 100755 --- a/Tools/geotag/geotag.sh +++ b/Tools/geotag/geotag.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Advanced geotagging tool by André Kjellstrup ###################################################################### VARIABLES ######################## diff --git a/Tools/gittools/git-commit-subsystems b/Tools/gittools/git-commit-subsystems index 4ef38059960b7..a06fa7dc54b28 100755 --- a/Tools/gittools/git-commit-subsystems +++ b/Tools/gittools/git-commit-subsystems @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash SCRIPT_DIR=$(dirname $(realpath ${BASH_SOURCE[0]})) GIT_DIR=$(git rev-parse --git-dir) diff --git a/Tools/gittools/git-subsystems-split b/Tools/gittools/git-subsystems-split index 1810aea8932c9..a8fd09787244a 100755 --- a/Tools/gittools/git-subsystems-split +++ b/Tools/gittools/git-subsystems-split @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash SCRIPT_DIR=$(dirname $(realpath ${BASH_SOURCE[0]})) GIT_DIR=$(git rev-parse --git-dir) diff --git a/Tools/gittools/path-libraries.sh b/Tools/gittools/path-libraries.sh index 14aaf4f2e33ce..711931776c62d 100755 --- a/Tools/gittools/path-libraries.sh +++ b/Tools/gittools/path-libraries.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash usage() { cat >&$1 <&$1 <