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`.
This commit is contained in:
Richard Marko 2023-12-04 10:55:08 +01:00 committed by Peter Barker
parent 0e36ca3154
commit 04b46678a4
63 changed files with 65 additions and 66 deletions

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
#" Autocompletion enabled vim for arduino pde's #" Autocompletion enabled vim for arduino pde's
ctags -RV --language-force=C++ --c++-kinds=+p --fields=+iaS --extra=+q \ ctags -RV --language-force=C++ --c++-kinds=+p --fields=+iaS --extra=+q \

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
#" Autocompletion enabled vim for arduino pde's #" Autocompletion enabled vim for arduino pde's
ctags -RV --language-force=C++ --c++-kinds=+p --fields=+iaS --extra=+q \ ctags -RV --language-force=C++ --c++-kinds=+p --fields=+iaS --extra=+q \

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
#make debug #make debug
#make test #make test
if [ ! -L /sys/class/gpio/gpio80 ] || [ ! -e /sys/class/gpio/gpio80 ] ; then if [ ! -L /sys/class/gpio/gpio80 ] || [ ! -e /sys/class/gpio/gpio80 ] ; then

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
if [ "`echo $1`" = "load" ]; then if [ "`echo $1`" = "load" ]; then
echo "Loading Test_Capes..." echo "Loading Test_Capes..."

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
cmd="plot " cmd="plot "
echo $# echo $#

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# an example script that starts udpproxy for multiple ports under GNU # an example script that starts udpproxy for multiple ports under GNU
# screen, allowing for unattended operation of the proxy for long # screen, allowing for unattended operation of the proxy for long
# periods # periods

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Try to run a command in an appropriate type of terminal window # Try to run a command in an appropriate type of terminal window
# depending on whats available # depending on whats available

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# script to more easily get a backtrace from an ArduPilot crash_dump.bin # script to more easily get a backtrace from an ArduPilot crash_dump.bin

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
#A simple script to install the APM SITL environment into cygwin #A simple script to install the APM SITL environment into cygwin

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
echo "---------- $0 start ----------" echo "---------- $0 start ----------"
set -e set -e
# set -x # set -x

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
set -x set -x

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
echo "---------- $0 start ----------" echo "---------- $0 start ----------"
set -e set -e
set -x set -x
@ -42,7 +42,7 @@ echo "Checking homebrew..."
$(which -s brew) || $(which -s brew) ||
{ {
echo "installing homebrew..." 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" echo "Homebrew installed"

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
echo "---------- $0 start ----------" echo "---------- $0 start ----------"
set -e set -e
set -x set -x

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
set -x set -x

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Advanced geotagging tool by André Kjellstrup # Advanced geotagging tool by André Kjellstrup
###################################################################### VARIABLES ######################## ###################################################################### VARIABLES ########################

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
SCRIPT_DIR=$(dirname $(realpath ${BASH_SOURCE[0]})) SCRIPT_DIR=$(dirname $(realpath ${BASH_SOURCE[0]}))
GIT_DIR=$(git rev-parse --git-dir) GIT_DIR=$(git rev-parse --git-dir)

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
SCRIPT_DIR=$(dirname $(realpath ${BASH_SOURCE[0]})) SCRIPT_DIR=$(dirname $(realpath ${BASH_SOURCE[0]}))
GIT_DIR=$(git rev-parse --git-dir) GIT_DIR=$(git rev-parse --git-dir)

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
usage() { usage() {
cat >&$1 <<EOF cat >&$1 <<EOF

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
usage() { usage() {
cat >&$1 <<EOF cat >&$1 <<EOF

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# this script sets up SITL to be able to attach to real CAN devices # this script sets up SITL to be able to attach to real CAN devices
# once run, you can configure SITL for CAN just like a real board, with the CAN parameters # once run, you can configure SITL for CAN just like a real board, with the CAN parameters
# #

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# once run, you can configure SITL for CAN just like a real board, with the CAN parameters # once run, you can configure SITL for CAN just like a real board, with the CAN parameters
# #

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
set -x set -x

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# useful script to test all the different build types that we support. # useful script to test all the different build types that we support.
# This helps when doing large merges # This helps when doing large merges
# Andrew Tridgell, November 2011 # Andrew Tridgell, November 2011

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# script to build 32 bit cygwin binaries for SITL # script to build 32 bit cygwin binaries for SITL
export PATH="/usr/local/bin:/usr/bin:/bin" export PATH="/usr/local/bin:/usr/bin:/bin"

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
export PATH=$HOME/.local/bin:/usr/local/bin:$HOME/prefix/bin:$HOME/gcc/active/bin:$PATH export PATH=$HOME/.local/bin:/usr/local/bin:$HOME/prefix/bin:$HOME/gcc/active/bin:$PATH
export PYTHONUNBUFFERED=1 export PYTHONUNBUFFERED=1

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# useful script to test all the different build types that we support. # useful script to test all the different build types that we support.
# This helps when doing large merges # This helps when doing large merges
# Andrew Tridgell, November 2011 # Andrew Tridgell, November 2011

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
set -x set -x

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
set -x set -x

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Install dependencies and configure the environment for CI build testing # Install dependencies and configure the environment for CI build testing
set -ex set -ex

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# script to build cygwin binaries for using in MissionPlanner # script to build cygwin binaries for using in MissionPlanner
# the contents of artifacts directory is uploaded to: # the contents of artifacts directory is uploaded to:

View File

@ -1,5 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# if you have modules/esp_idf setup as a submodule, then leave it as a submodule and switch branches # if you have modules/esp_idf setup as a submodule, then leave it as a submodule and switch branches
if [ ! -d modules ]; then if [ ! -d modules ]; then
echo "this script needs to be run from the root of your repo, sorry, giving up." echo "this script needs to be run from the root of your repo, sorry, giving up."
@ -60,4 +59,4 @@ git submodule update --init --recursive
cd ../.. cd ../..
echo "after changing IDF versions [ such as between 4.2 and 4.4 ] you should re-run these in your console:" echo "after changing IDF versions [ such as between 4.2 and 4.4 ] you should re-run these in your console:"
echo "./modules/esp_idf/install.sh" echo "./modules/esp_idf/install.sh"
echo "source ./modules/esp_idf/export.sh" echo "source ./modules/esp_idf/export.sh"

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
src=$(realpath $(dirname $BASH_SOURCE)/../../) src=$(realpath $(dirname $BASH_SOURCE)/../../)
base=$src/libraries base=$src/libraries

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
function format { function format {
DIR=$1 DIR=$1
find $DIR -regex ".*\.\(h\|cpp\|pde\)" -exec astyle {} \; find $DIR -regex ".*\.\(h\|cpp\|pde\)" -exec astyle {} \;

View File

@ -14,4 +14,4 @@ ssh $USER_HOST /bin/bash << ENDSSH
source ~/.bash_profile source ~/.bash_profile
$tmpdir/uploader.py $tmpdir/$filename $tmpdir/uploader.py $tmpdir/$filename
rm -r $tmpdir rm -r $tmpdir
ENDSSH ENDSSH

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Run lua check for all lua files passing AP specific config # Run lua check for all lua files passing AP specific config
# Can also pass any number of arguments that are passed onto luacheck # Can also pass any number of arguments that are passed onto luacheck
# for example the path of a single script could be given # for example the path of a single script could be given

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# unpack latest MissionPlanner*.zip on firmware.ardupilot.org # unpack latest MissionPlanner*.zip on firmware.ardupilot.org
# to facilitate upgrade of existing MissionPlanner installs # to facilitate upgrade of existing MissionPlanner installs

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
echo "---------- $0 start ----------" echo "---------- $0 start ----------"
set -e set -e

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# this script is run by the root user in the virtual machine # this script is run by the root user in the virtual machine

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
echo "---------- $0 start ----------" echo "---------- $0 start ----------"
# this script is run by the root user in the virtual machine # this script is run by the root user in the virtual machine

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR/.. cd $DIR/..

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR/.. cd $DIR/..

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR/.. cd $DIR/..

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR/.. cd $DIR/..

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR/.. cd $DIR/..

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Build and run the motors example stability test at a range of yaw headroom and throttle average max values # Build and run the motors example stability test at a range of yaw headroom and throttle average max values
# Output results to files for comparison # Output results to files for comparison

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# two planes flying together doing aerobatics # two planes flying together doing aerobatics

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Example script for multi-vehicle simulation with AirSim # Example script for multi-vehicle simulation with AirSim
# see https://ardupilot.org/dev/docs/sitl-with-airsim.html#multi-vehicle-simulation for details # see https://ardupilot.org/dev/docs/sitl-with-airsim.html#multi-vehicle-simulation for details

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Example script for multi-vehicle simulation with AirSim and usage with ROS # Example script for multi-vehicle simulation with AirSim and usage with ROS
# see https://ardupilot.org/dev/docs/sitl-with-airsim.html#multi-vehicle-simulation for details # see https://ardupilot.org/dev/docs/sitl-with-airsim.html#multi-vehicle-simulation for details

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# a quad following a plane # a quad following a plane

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# assume we start the script from the root directory # assume we start the script from the root directory
ROOTDIR=$PWD ROOTDIR=$PWD

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# assume we start the script from the root directory # assume we start the script from the root directory
ROOTDIR=$PWD ROOTDIR=$PWD

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# assume we start the script from the root directory # assume we start the script from the root directory
ROOTDIR=$PWD ROOTDIR=$PWD

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# assume we start the script from the root directory # assume we start the script from the root directory

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# assume we start the script from the root directory # assume we start the script from the root directory
ROOTDIR=$PWD ROOTDIR=$PWD

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# assume we start the script from the root directory # assume we start the script from the root directory
ROOTDIR=$PWD ROOTDIR=$PWD

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# assume we start the script from the root directory # assume we start the script from the root directory
ROOTDIR=$PWD ROOTDIR=$PWD

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# assume we start the script from the root directory # assume we start the script from the root directory
ROOTDIR=$PWD ROOTDIR=$PWD

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# assume we start the script from the root directory # assume we start the script from the root directory
ROOTDIR=$PWD ROOTDIR=$PWD

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Usage - From ardupilot root directory, run - libraries/SITL/examples/follow-copter.sh $GCS_IP # Usage - From ardupilot root directory, run - libraries/SITL/examples/follow-copter.sh $GCS_IP
# $GCS_IP is the IP address of the system running the GCs, by default is 127.0.0.1 # $GCS_IP is the IP address of the system running the GCs, by default is 127.0.0.1

View File

@ -1,3 +1,3 @@
#!/bin/bash #!/usr/bin/env bash
mavproxy.py --master=mcast: --console --map --cmd='map set showgpspos 0; map set showgps2pos 0;' mavproxy.py --master=mcast: --console --map --cmd='map set showgpspos 0; map set showgps2pos 0;'

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
rm -rf html rm -rf html
svn cleanup svn cleanup
svn update html svn update html