diff --git a/launch_chffrplus.sh b/launch_chffrplus.sh index 9256f463af..442a811b16 100755 --- a/launch_chffrplus.sh +++ b/launch_chffrplus.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash if [ -z "$BASEDIR" ]; then BASEDIR="/data/openpilot" diff --git a/launch_env.sh b/launch_env.sh index 81578aff01..1e5bc7b607 100755 --- a/launch_env.sh +++ b/launch_env.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash export OMP_NUM_THREADS=1 export MKL_NUM_THREADS=1 diff --git a/launch_openpilot.sh b/launch_openpilot.sh index 2888814c22..d6e3424c34 100755 --- a/launch_openpilot.sh +++ b/launch_openpilot.sh @@ -1,3 +1,3 @@ -#!/usr/bin/bash +#!/usr/bin/env bash exec ./launch_chffrplus.sh diff --git a/release/build_devel.sh b/release/build_devel.sh index 7fce11ca72..c6d04396fe 100755 --- a/release/build_devel.sh +++ b/release/build_devel.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash set -ex DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" diff --git a/release/build_release.sh b/release/build_release.sh index 510df75e51..bcc4b5cded 100755 --- a/release/build_release.sh +++ b/release/build_release.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash set -e set -x diff --git a/release/check-dirty.sh b/release/check-dirty.sh index 9c6389f380..ac049970cf 100755 --- a/release/check-dirty.sh +++ b/release/check-dirty.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash set -e DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" diff --git a/release/check-submodules.sh b/release/check-submodules.sh index 5305cecd3a..48850deaf8 100755 --- a/release/check-submodules.sh +++ b/release/check-submodules.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash while read hash submodule ref; do git -C $submodule fetch --depth 3000 origin master diff --git a/scripts/apply-pr.sh b/scripts/apply-pr.sh index 74f765391a..ad0af46b49 100755 --- a/scripts/apply-pr.sh +++ b/scripts/apply-pr.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash if [ $# -eq 0 ]; then echo "usage: $0 " diff --git a/scripts/build_small.sh b/scripts/build_small.sh index 90f55373e2..176ca5aaa8 100755 --- a/scripts/build_small.sh +++ b/scripts/build_small.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -ex DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" diff --git a/scripts/cell.sh b/scripts/cell.sh index 4ba007a532..310a9694fd 100755 --- a/scripts/cell.sh +++ b/scripts/cell.sh @@ -1,3 +1,3 @@ -#!/usr/bin/bash +#!/usr/bin/env bash nmcli connection modify --temporary esim ipv4.route-metric 1 ipv6.route-metric 1 nmcli con up esim diff --git a/scripts/checkout-pr.sh b/scripts/checkout-pr.sh index 43f658beff..eeba816d88 100755 --- a/scripts/checkout-pr.sh +++ b/scripts/checkout-pr.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e if [ $# -eq 0 ]; then diff --git a/scripts/launch_corolla.sh b/scripts/launch_corolla.sh index 4e5bca6ce5..926569a1e0 100755 --- a/scripts/launch_corolla.sh +++ b/scripts/launch_corolla.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" diff --git a/scripts/lint.sh b/scripts/lint.sh index 2b6fd07185..9f4db8e35b 100755 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e RED='\033[0;31m' diff --git a/scripts/retry.sh b/scripts/retry.sh index 4861748e55..23501d7559 100755 --- a/scripts/retry.sh +++ b/scripts/retry.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash function fail { echo $1 >&2 diff --git a/selfdrive/assets/compress-images.sh b/selfdrive/assets/compress-images.sh index a1a4f8bb40..de59099bd1 100755 --- a/selfdrive/assets/compress-images.sh +++ b/selfdrive/assets/compress-images.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash echo "compressing training guide images" optipng -o7 -strip all training/* diff --git a/selfdrive/assets/strip-svg-metadata.sh b/selfdrive/assets/strip-svg-metadata.sh index a8b35eadde..e51dc9481d 100755 --- a/selfdrive/assets/strip-svg-metadata.sh +++ b/selfdrive/assets/strip-svg-metadata.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # sudo apt install scour diff --git a/selfdrive/car/tests/big_cars_test.sh b/selfdrive/car/tests/big_cars_test.sh index af45c9cd14..8b0e96d980 100755 --- a/selfdrive/car/tests/big_cars_test.sh +++ b/selfdrive/car/tests/big_cars_test.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash SCRIPT_DIR=$(dirname "$0") BASEDIR=$(realpath "$SCRIPT_DIR/../../../") @@ -9,4 +9,4 @@ INTERNAL_SEG_CNT=300 FILEREADER_CACHE=1 INTERNAL_SEG_LIST=selfdrive/car/tests/test_models_segs.txt -cd selfdrive/car/tests && pytest test_models.py test_car_interfaces.py \ No newline at end of file +cd selfdrive/car/tests && pytest test_models.py test_car_interfaces.py diff --git a/selfdrive/debug/adb.sh b/selfdrive/debug/adb.sh index 919a82fefc..8fa267fd4d 100755 --- a/selfdrive/debug/adb.sh +++ b/selfdrive/debug/adb.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash set -e PORT=5555 diff --git a/selfdrive/modeld/tests/tf_test/build.sh b/selfdrive/modeld/tests/tf_test/build.sh index 4e92ca0698..df1d24761e 100755 --- a/selfdrive/modeld/tests/tf_test/build.sh +++ b/selfdrive/modeld/tests/tf_test/build.sh @@ -1,2 +1,2 @@ -#!/bin/bash +#!/usr/bin/env bash clang++ -I /home/batman/one/external/tensorflow/include/ -L /home/batman/one/external/tensorflow/lib -Wl,-rpath=/home/batman/one/external/tensorflow/lib main.cc -ltensorflow diff --git a/selfdrive/test/scons_build_test.sh b/selfdrive/test/scons_build_test.sh index a3b33f797a..efc9469deb 100755 --- a/selfdrive/test/scons_build_test.sh +++ b/selfdrive/test/scons_build_test.sh @@ -1,10 +1,10 @@ -#!/bin/bash +#!/usr/bin/env bash SCRIPT_DIR=$(dirname "$0") BASEDIR=$(realpath "$SCRIPT_DIR/../../") cd $BASEDIR -# tests that our build system's dependencies are configured properly, +# tests that our build system's dependencies are configured properly, # needs a machine with lots of cores scons --clean -scons --no-cache --random -j$(nproc) \ No newline at end of file +scons --no-cache --random -j$(nproc) diff --git a/selfdrive/test/setup_device_ci.sh b/selfdrive/test/setup_device_ci.sh index 84dae25821..fdc222e7e7 100755 --- a/selfdrive/test/setup_device_ci.sh +++ b/selfdrive/test/setup_device_ci.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash set -e @@ -23,7 +23,7 @@ rm -rf /data/safe_staging/* || true CONTINUE_PATH="/data/continue.sh" tee $CONTINUE_PATH << EOF -#!/usr/bin/bash +#!/usr/bin/env bash sudo abctl --set_success diff --git a/selfdrive/test/setup_vsound.sh b/selfdrive/test/setup_vsound.sh index a6601d0a61..aab1499744 100755 --- a/selfdrive/test/setup_vsound.sh +++ b/selfdrive/test/setup_vsound.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash { #start pulseaudio daemon diff --git a/selfdrive/ui/installer/continue_openpilot.sh b/selfdrive/ui/installer/continue_openpilot.sh index 3da67313eb..ed41ab6f3f 100755 --- a/selfdrive/ui/installer/continue_openpilot.sh +++ b/selfdrive/ui/installer/continue_openpilot.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash cd /data/openpilot exec ./launch_openpilot.sh diff --git a/selfdrive/ui/tests/create_test_translations.sh b/selfdrive/ui/tests/create_test_translations.sh index 451a3cbfb0..ed0890d946 100755 --- a/selfdrive/ui/tests/create_test_translations.sh +++ b/selfdrive/ui/tests/create_test_translations.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e diff --git a/system/hardware/tici/restart_modem.sh b/system/hardware/tici/restart_modem.sh index 3c67d9d21d..741dc72050 100755 --- a/system/hardware/tici/restart_modem.sh +++ b/system/hardware/tici/restart_modem.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash #nmcli connection modify --temporary lte gsm.home-only yes #nmcli connection modify --temporary lte gsm.auto-config yes diff --git a/tools/joystick/joystickd.py b/tools/joystick/joystickd.py index 176ff25be6..6b85be8777 100755 --- a/tools/joystick/joystickd.py +++ b/tools/joystick/joystickd.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import os import argparse import threading diff --git a/tools/lib/kbhit.py b/tools/lib/kbhit.py index 4451d02aea..3881ee7d18 100755 --- a/tools/lib/kbhit.py +++ b/tools/lib/kbhit.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import sys import termios import atexit diff --git a/tools/profiling/clpeak/build.sh b/tools/profiling/clpeak/build.sh index 1dcb05cbbc..5206ed0c45 100755 --- a/tools/profiling/clpeak/build.sh +++ b/tools/profiling/clpeak/build.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" cd $DIR diff --git a/tools/profiling/ftrace.sh b/tools/profiling/ftrace.sh index fe91a3c0d9..7d5d1f5f9d 100755 --- a/tools/profiling/ftrace.sh +++ b/tools/profiling/ftrace.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash set -e cd /sys/kernel/tracing diff --git a/tools/profiling/palanteer/setup.sh b/tools/profiling/palanteer/setup.sh index e912a9367f..6f115dc86b 100755 --- a/tools/profiling/palanteer/setup.sh +++ b/tools/profiling/palanteer/setup.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e diff --git a/tools/profiling/perfetto/build.sh b/tools/profiling/perfetto/build.sh index 448c1d04ae..24255ac3b0 100755 --- a/tools/profiling/perfetto/build.sh +++ b/tools/profiling/perfetto/build.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash if [ ! -d perfetto ]; then git clone https://android.googlesource.com/platform/external/perfetto/ diff --git a/tools/profiling/perfetto/copy.sh b/tools/profiling/perfetto/copy.sh index 8deca9a6e7..b91d49a80b 100755 --- a/tools/profiling/perfetto/copy.sh +++ b/tools/profiling/perfetto/copy.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash DEST=tici:/data/openpilot/selfdrive/debug/profiling/perfetto diff --git a/tools/profiling/perfetto/record.sh b/tools/profiling/perfetto/record.sh index 99f2168771..9715a7e7e9 100755 --- a/tools/profiling/perfetto/record.sh +++ b/tools/profiling/perfetto/record.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" cd $DIR diff --git a/tools/profiling/perfetto/server.sh b/tools/profiling/perfetto/server.sh index 19958c653b..103ad9bd84 100755 --- a/tools/profiling/perfetto/server.sh +++ b/tools/profiling/perfetto/server.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash curl -LO https://get.perfetto.dev/trace_processor chmod +x ./trace_processor diff --git a/tools/profiling/perfetto/traces.sh b/tools/profiling/perfetto/traces.sh index 489b042377..17ca89da72 100755 --- a/tools/profiling/perfetto/traces.sh +++ b/tools/profiling/perfetto/traces.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash DEST=tici:/data/openpilot/selfdrive/debug/profiling/perfetto diff --git a/tools/profiling/snapdragon/setup-agnos.sh b/tools/profiling/snapdragon/setup-agnos.sh index f036ca2111..9a781bf3ce 100755 --- a/tools/profiling/snapdragon/setup-agnos.sh +++ b/tools/profiling/snapdragon/setup-agnos.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # TODO: there's probably a better way to do this diff --git a/tools/profiling/snapdragon/setup-profiler.sh b/tools/profiling/snapdragon/setup-profiler.sh index aaec1bf756..b97c1ae688 100755 --- a/tools/profiling/snapdragon/setup-profiler.sh +++ b/tools/profiling/snapdragon/setup-profiler.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # install depends sudo apt update @@ -11,4 +11,4 @@ echo "deb https://download.mono-project.com/repo/ubuntu stable-xenial main" | su sudo apt update sudo apt-get install -y mono-complete -echo "Setup successful, you should now be able to run the profiler with cd SnapdragonProfiler and ./run_sdp.sh" \ No newline at end of file +echo "Setup successful, you should now be able to run the profiler with cd SnapdragonProfiler and ./run_sdp.sh" diff --git a/tools/profiling/watch-irqs.sh b/tools/profiling/watch-irqs.sh index 34cc4596f4..4e5cfde3c8 100755 --- a/tools/profiling/watch-irqs.sh +++ b/tools/profiling/watch-irqs.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash set -e RUBYOPT="-W0" irqtop -d1 -R diff --git a/tools/rerun/run.sh b/tools/rerun/run.sh index 25190411d1..0c02615360 100755 --- a/tools/rerun/run.sh +++ b/tools/rerun/run.sh @@ -1,4 +1,4 @@ -#! /bin/bash +#!/usr/bin/env bash # TODO: remove this file once Rerun has interface to set log message level set -e diff --git a/tools/scripts/save_ubloxraw_stream.py b/tools/scripts/save_ubloxraw_stream.py index ecbc2bb31e..b5354a7831 100755 --- a/tools/scripts/save_ubloxraw_stream.py +++ b/tools/scripts/save_ubloxraw_stream.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import argparse import os import sys diff --git a/tools/serial/connect.sh b/tools/serial/connect.sh index a073310b0a..0ea4a73620 100755 --- a/tools/serial/connect.sh +++ b/tools/serial/connect.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash while true; do if ls /dev/serial/by-id/usb-FTDI_FT230X* 2> /dev/null; then diff --git a/tools/sim/launch_openpilot.sh b/tools/sim/launch_openpilot.sh index 1b4ac4ef84..30c5b73827 100755 --- a/tools/sim/launch_openpilot.sh +++ b/tools/sim/launch_openpilot.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash export PASSIVE="0" export NOBOARD="1" diff --git a/tools/sim/run_bridge.py b/tools/sim/run_bridge.py index 0992ef4bfe..b4da703da0 100755 --- a/tools/sim/run_bridge.py +++ b/tools/sim/run_bridge.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import argparse from typing import Any diff --git a/tools/webcam/start_camerad.sh b/tools/webcam/start_camerad.sh index fbda2be9f3..d4828b3e25 100755 --- a/tools/webcam/start_camerad.sh +++ b/tools/webcam/start_camerad.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # export the block below when call manager.py export BLOCK="${BLOCK},camerad"