Skip to content

Commit

Permalink
treewide: fix shebangs - /bin/bash -> /usr/bin/env bash
Browse files Browse the repository at this point in the history
Most scripts/tools use non-portable `/bin/bash`, switch
to environment agnostic `/usr/bin/env bash`.
  • Loading branch information
sorki authored and peterbarker committed Feb 13, 2024
1 parent 0e36ca3 commit 04b4667
Show file tree
Hide file tree
Showing 63 changed files with 65 additions and 66 deletions.
2 changes: 1 addition & 1 deletion ArduPlane/createTags
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion Rover/createTags
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion Tools/Linux_HAL_Essentials/pru/aiopru/start_test
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion Tools/Linux_HAL_Essentials/startup.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

if [ "`echo $1`" = "load" ]; then
echo "Loading Test_Capes..."
Expand Down
2 changes: 1 addition & 1 deletion Tools/Replay/plotit.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

cmd="plot "
echo $#
Expand Down
2 changes: 1 addition & 1 deletion Tools/UDP_Proxy/start_proxies.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion Tools/autotest/run_in_terminal_window.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion Tools/debug/gdb_crashdump.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# script to more easily get a backtrace from an ArduPilot crash_dump.bin

Expand Down
2 changes: 1 addition & 1 deletion Tools/environment_install/APM_install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

#A simple script to install the APM SITL environment into cygwin

Expand Down
2 changes: 1 addition & 1 deletion Tools/environment_install/install-ROS-ubuntu.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
echo "---------- $0 start ----------"
set -e
# set -x
Expand Down
2 changes: 1 addition & 1 deletion Tools/environment_install/install-prereqs-arch.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e
set -x

Expand Down
4 changes: 2 additions & 2 deletions Tools/environment_install/install-prereqs-mac.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
echo "---------- $0 start ----------"
set -e
set -x
Expand Down Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion Tools/environment_install/install-prereqs-ubuntu.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
echo "---------- $0 start ----------"
set -e
set -x
Expand Down
2 changes: 1 addition & 1 deletion Tools/environment_install/ubuntu-18.04-python3.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -e
set -x
Expand Down
2 changes: 1 addition & 1 deletion Tools/geotag/geotag.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Advanced geotagging tool by André Kjellstrup
###################################################################### VARIABLES ########################
Expand Down
2 changes: 1 addition & 1 deletion Tools/gittools/git-commit-subsystems
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

SCRIPT_DIR=$(dirname $(realpath ${BASH_SOURCE[0]}))
GIT_DIR=$(git rev-parse --git-dir)
Expand Down
2 changes: 1 addition & 1 deletion Tools/gittools/git-subsystems-split
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

SCRIPT_DIR=$(dirname $(realpath ${BASH_SOURCE[0]}))
GIT_DIR=$(git rev-parse --git-dir)
Expand Down
2 changes: 1 addition & 1 deletion Tools/gittools/path-libraries.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

usage() {
cat >&$1 <<EOF
Expand Down
2 changes: 1 addition & 1 deletion Tools/gittools/path-nonlibraries.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

usage() {
cat >&$1 <<EOF
Expand Down
2 changes: 1 addition & 1 deletion Tools/scripts/CAN/can_sitl.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# 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
#
Expand Down
2 changes: 1 addition & 1 deletion Tools/scripts/CAN/can_sitl_nodev.sh
Original file line number Diff line number Diff line change
@@ -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
#
Expand Down
2 changes: 1 addition & 1 deletion Tools/scripts/build-jsbsim.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -e
set -x
Expand Down
2 changes: 1 addition & 1 deletion Tools/scripts/build_all.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# useful script to test all the different build types that we support.
# This helps when doing large merges
# Andrew Tridgell, November 2011
Expand Down
2 changes: 1 addition & 1 deletion Tools/scripts/build_appveyor.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# script to build 32 bit cygwin binaries for SITL

export PATH="/usr/local/bin:/usr/bin:/bin"
Expand Down
2 changes: 1 addition & 1 deletion Tools/scripts/build_autotest.sh
Original file line number Diff line number Diff line change
@@ -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 PYTHONUNBUFFERED=1
Expand Down
2 changes: 1 addition & 1 deletion Tools/scripts/build_ci.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# useful script to test all the different build types that we support.
# This helps when doing large merges
# Andrew Tridgell, November 2011
Expand Down
2 changes: 1 addition & 1 deletion Tools/scripts/build_docs.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -e

Expand Down
2 changes: 1 addition & 1 deletion Tools/scripts/build_examples.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -e

Expand Down
2 changes: 1 addition & 1 deletion Tools/scripts/build_log_message_documentation.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -e
set -x
Expand Down
2 changes: 1 addition & 1 deletion Tools/scripts/build_parameters.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -e
set -x
Expand Down
2 changes: 1 addition & 1 deletion Tools/scripts/configure-ci.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Install dependencies and configure the environment for CI build testing

set -ex
Expand Down
2 changes: 1 addition & 1 deletion Tools/scripts/cygwin_build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# script to build cygwin binaries for using in MissionPlanner
# the contents of artifacts directory is uploaded to:
Expand Down
5 changes: 2 additions & 3 deletions Tools/scripts/esp32_get_idf.sh
Original file line number Diff line number Diff line change
@@ -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 [ ! -d modules ]; then
echo "this script needs to be run from the root of your repo, sorry, giving up."
Expand Down Expand Up @@ -60,4 +59,4 @@ git submodule update --init --recursive
cd ../..
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 "source ./modules/esp_idf/export.sh"
echo "source ./modules/esp_idf/export.sh"
2 changes: 1 addition & 1 deletion Tools/scripts/fix_libraries_includes.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

src=$(realpath $(dirname $BASH_SOURCE)/../../)
base=$src/libraries
Expand Down
2 changes: 1 addition & 1 deletion Tools/scripts/format.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
function format {
DIR=$1
find $DIR -regex ".*\.\(h\|cpp\|pde\)" -exec astyle {} \;
Expand Down
2 changes: 1 addition & 1 deletion Tools/scripts/macos_remote_upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ ssh $USER_HOST /bin/bash << ENDSSH
source ~/.bash_profile
$tmpdir/uploader.py $tmpdir/$filename
rm -r $tmpdir
ENDSSH
ENDSSH
2 changes: 1 addition & 1 deletion Tools/scripts/run_luacheck.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Run lua check for all lua files passing AP specific config
# Can also pass any number of arguments that are passed onto luacheck
# for example the path of a single script could be given
Expand Down
2 changes: 1 addition & 1 deletion Tools/scripts/unpack_mp.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# unpack latest MissionPlanner*.zip on firmware.ardupilot.org
# to facilitate upgrade of existing MissionPlanner installs
Expand Down
2 changes: 1 addition & 1 deletion Tools/vagrant/initvagrant-desktop.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
echo "---------- $0 start ----------"

set -e
Expand Down
2 changes: 1 addition & 1 deletion Tools/vagrant/initvagrant-trusty64.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# this script is run by the root user in the virtual machine

Expand Down
2 changes: 1 addition & 1 deletion Tools/vagrant/initvagrant.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
echo "---------- $0 start ----------"

# this script is run by the root user in the virtual machine
Expand Down
2 changes: 1 addition & 1 deletion docs/build-apmrover2.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

cd $DIR/..
Expand Down
2 changes: 1 addition & 1 deletion docs/build-arducopter.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

cd $DIR/..
Expand Down
2 changes: 1 addition & 1 deletion docs/build-arduplane.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

cd $DIR/..
Expand Down
2 changes: 1 addition & 1 deletion docs/build-ardusub.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

cd $DIR/..
Expand Down
2 changes: 1 addition & 1 deletion docs/build-libs.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

cd $DIR/..
Expand Down
Original file line number Diff line number Diff line change
@@ -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
# Output results to files for comparison

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# two planes flying together doing aerobatics

Expand Down
2 changes: 1 addition & 1 deletion libraries/SITL/examples/Airsim/follow-copter.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Example script for multi-vehicle simulation with AirSim
# see https://ardupilot.org/dev/docs/sitl-with-airsim.html#multi-vehicle-simulation for details
Expand Down
2 changes: 1 addition & 1 deletion libraries/SITL/examples/Airsim/multi_vehicle.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# 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
Expand Down
2 changes: 1 addition & 1 deletion libraries/SITL/examples/Follow/plane_quad.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# a quad following a plane

Expand Down
2 changes: 1 addition & 1 deletion libraries/SITL/examples/Morse/start_follow.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# assume we start the script from the root directory
ROOTDIR=$PWD
Expand Down
2 changes: 1 addition & 1 deletion libraries/SITL/examples/Webots/dronePlus.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# assume we start the script from the root directory
ROOTDIR=$PWD
Expand Down
2 changes: 1 addition & 1 deletion libraries/SITL/examples/Webots/droneTricopter.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# assume we start the script from the root directory
ROOTDIR=$PWD
Expand Down
2 changes: 1 addition & 1 deletion libraries/SITL/examples/Webots/droneTwoTricopters.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# assume we start the script from the root directory

Expand Down
2 changes: 1 addition & 1 deletion libraries/SITL/examples/Webots/droneX.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# assume we start the script from the root directory
ROOTDIR=$PWD
Expand Down
2 changes: 1 addition & 1 deletion libraries/SITL/examples/Webots/droneX_TwoDrones.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# assume we start the script from the root directory
ROOTDIR=$PWD
Expand Down
2 changes: 1 addition & 1 deletion libraries/SITL/examples/Webots/pyramids_droneX.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# assume we start the script from the root directory
ROOTDIR=$PWD
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# assume we start the script from the root directory
ROOTDIR=$PWD
Expand Down
2 changes: 1 addition & 1 deletion libraries/SITL/examples/Webots/rover.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# assume we start the script from the root directory
ROOTDIR=$PWD
Expand Down
2 changes: 1 addition & 1 deletion libraries/SITL/examples/follow-copter.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# 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
Expand Down
2 changes: 1 addition & 1 deletion libraries/SITL/examples/follow-mavproxy.sh
Original file line number Diff line number Diff line change
@@ -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;'
2 changes: 1 addition & 1 deletion libraries/doc/updateDocs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
rm -rf html
svn cleanup
svn update html
Expand Down

0 comments on commit 04b4667

Please sign in to comment.