From e94288da3132689af96e432fc3d0782d2400cc77 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Fri, 3 Apr 2020 01:10:02 +0200 Subject: [PATCH] global: use '/usr/bin/env bash' instead of '/usr/bin/bash' in shebangs Using the method from @cemeyer (https://github.com/espressif/esp-idf/pull/3166): find . -name \*.sh -exec sed -i "" -e 's|^#!.*bin/bash|#!/usr/bin/env bash|' {} + Closes https://github.com/espressif/esp-idf/pull/3166. --- components/esp_wifi/test_md5/test_md5.sh | 2 +- components/espcoredump/test/test_espcoredump.sh | 2 +- components/heap/test_multi_heap_host/test_all_configs.sh | 2 +- docs/check_lang_folder_sync.sh | 2 +- examples/build_system/cmake/idf_as_lib/build-esp32.sh | 4 ++-- examples/build_system/cmake/idf_as_lib/build.sh | 4 ++-- examples/build_system/cmake/idf_as_lib/run-esp32.sh | 4 ++-- examples/build_system/cmake/idf_as_lib/run.sh | 4 ++-- examples/storage/parttool/parttool_example.sh | 4 ++-- examples/system/ota/otatool/otatool_example.sh | 4 ++-- tools/ci/build_examples.sh | 2 +- tools/ci/build_examples_cmake.sh | 2 +- tools/ci/build_test_apps.sh | 2 +- tools/ci/check-executable.sh | 2 +- tools/ci/check_examples_cmake_make.sh | 2 +- tools/ci/check_examples_rom_header.sh | 2 +- tools/ci/check_idf_version.sh | 2 +- tools/ci/check_ut_cmake_make.sh | 4 ++-- tools/ci/fix_empty_prototypes.sh | 2 +- tools/ci/get-full-sources.sh | 2 +- tools/ci/get_supported_examples.sh | 2 +- tools/ci/mirror-submodule-update.sh | 2 +- tools/ci/multirun_with_pyenv.sh | 2 +- tools/ci/push_to_github.sh | 2 +- tools/ci/setup_python.sh | 2 +- tools/ci/test_build_system.sh | 2 +- tools/ci/test_build_system_cmake.sh | 2 +- tools/ci/test_configure_ci_environment.sh | 2 +- tools/cmake/run_cmake_lint.sh | 2 +- tools/docker/entrypoint.sh | 2 +- tools/esp_app_trace/test/logtrace/test.sh | 2 +- tools/esp_app_trace/test/sysview/test.sh | 2 +- tools/format-minimal.sh | 2 +- tools/format.sh | 2 +- tools/kconfig/lxdialog/check-lxdialog.sh | 2 +- tools/set-submodules-to-github.sh | 2 +- tools/test_idf_size/test.sh | 2 +- tools/unit-test-app/tools/get_available_configs.sh | 2 +- tools/windows/eclipse_make.sh | 2 +- tools/windows/tool_setup/build_installer.sh | 2 +- tools/windows/tool_setup/sign_installer.sh | 2 +- tools/windows/windows_install_prerequisites.sh | 2 +- 42 files changed, 49 insertions(+), 49 deletions(-) diff --git a/components/esp_wifi/test_md5/test_md5.sh b/components/esp_wifi/test_md5/test_md5.sh index 2c76c8445..e51e36334 100755 --- a/components/esp_wifi/test_md5/test_md5.sh +++ b/components/esp_wifi/test_md5/test_md5.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail diff --git a/components/espcoredump/test/test_espcoredump.sh b/components/espcoredump/test/test_espcoredump.sh index 63b8c0a48..3f097deb0 100755 --- a/components/espcoredump/test/test_espcoredump.sh +++ b/components/espcoredump/test/test_espcoredump.sh @@ -1,4 +1,4 @@ -#! /bin/bash +#!/usr/bin/env bash { coverage debug sys \ && coverage erase \ diff --git a/components/heap/test_multi_heap_host/test_all_configs.sh b/components/heap/test_multi_heap_host/test_all_configs.sh index 46ee8a0d3..15bf40a12 100755 --- a/components/heap/test_multi_heap_host/test_all_configs.sh +++ b/components/heap/test_multi_heap_host/test_all_configs.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Run the test suite with all configurations enabled # diff --git a/docs/check_lang_folder_sync.sh b/docs/check_lang_folder_sync.sh index 96de9994c..4d875a855 100755 --- a/docs/check_lang_folder_sync.sh +++ b/docs/check_lang_folder_sync.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Check if folders with localized documentation are in sync # diff --git a/examples/build_system/cmake/idf_as_lib/build-esp32.sh b/examples/build_system/cmake/idf_as_lib/build-esp32.sh index a313c6c36..c30f83226 100755 --- a/examples/build_system/cmake/idf_as_lib/build-esp32.sh +++ b/examples/build_system/cmake/idf_as_lib/build-esp32.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash rm -rf build && mkdir build && cd build cmake .. -DCMAKE_TOOLCHAIN_FILE=$IDF_PATH/tools/cmake/toolchain-esp32.cmake -DTARGET=esp32 -GNinja -cmake --build . \ No newline at end of file +cmake --build . diff --git a/examples/build_system/cmake/idf_as_lib/build.sh b/examples/build_system/cmake/idf_as_lib/build.sh index 85ffed789..a42c91510 100755 --- a/examples/build_system/cmake/idf_as_lib/build.sh +++ b/examples/build_system/cmake/idf_as_lib/build.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash rm -rf build && mkdir build && cd build cmake .. -cmake --build . \ No newline at end of file +cmake --build . diff --git a/examples/build_system/cmake/idf_as_lib/run-esp32.sh b/examples/build_system/cmake/idf_as_lib/run-esp32.sh index ab1677a9a..4c2b2ea5d 100755 --- a/examples/build_system/cmake/idf_as_lib/run-esp32.sh +++ b/examples/build_system/cmake/idf_as_lib/run-esp32.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash cd build python $IDF_PATH/components/esptool_py/esptool/esptool.py -p $1 write_flash @flash_project_args -python $IDF_PATH/tools/idf_monitor.py -p $1 idf_as_lib.elf \ No newline at end of file +python $IDF_PATH/tools/idf_monitor.py -p $1 idf_as_lib.elf diff --git a/examples/build_system/cmake/idf_as_lib/run.sh b/examples/build_system/cmake/idf_as_lib/run.sh index 30186ca2c..f7747ac02 100755 --- a/examples/build_system/cmake/idf_as_lib/run.sh +++ b/examples/build_system/cmake/idf_as_lib/run.sh @@ -1,3 +1,3 @@ -#!/bin/bash +#!/usr/bin/env bash cd build -./idf_as_lib.elf \ No newline at end of file +./idf_as_lib.elf diff --git a/examples/storage/parttool/parttool_example.sh b/examples/storage/parttool/parttool_example.sh index 888c91468..586d0aae6 100644 --- a/examples/storage/parttool/parttool_example.sh +++ b/examples/storage/parttool/parttool_example.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Demonstrates command-line interface of Partition Tool, parttool.py # @@ -70,4 +70,4 @@ assert_file_same read.bin blank.bin "Contents of storage partition not fully era # Example end and cleanup printf "\nPartition tool operations performed successfully\n" -rm -rf app.bin read.bin blank.bin write.bin \ No newline at end of file +rm -rf app.bin read.bin blank.bin write.bin diff --git a/examples/system/ota/otatool/otatool_example.sh b/examples/system/ota/otatool/otatool_example.sh index bcf8456dc..ede4fecf0 100644 --- a/examples/system/ota/otatool/otatool_example.sh +++ b/examples/system/ota/otatool/otatool_example.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Demonstrates command-line interface of OTA Partitions Tool, otatool.py # @@ -92,4 +92,4 @@ assert_running_partition ota_1 # Example end and cleanup printf "\nPartition tool operations performed successfully\n" -rm -rf app0.bin app1.bin \ No newline at end of file +rm -rf app0.bin app1.bin diff --git a/tools/ci/build_examples.sh b/tools/ci/build_examples.sh index 9dc831d43..f8f6d5db4 100755 --- a/tools/ci/build_examples.sh +++ b/tools/ci/build_examples.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Build all examples from the examples directory, out of tree to # ensure they can run when copied to a new directory. diff --git a/tools/ci/build_examples_cmake.sh b/tools/ci/build_examples_cmake.sh index 8205aa17f..ce330ab2a 100755 --- a/tools/ci/build_examples_cmake.sh +++ b/tools/ci/build_examples_cmake.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Build all examples from the examples directory, in BUILD_PATH to # ensure they can run when copied to a new directory. diff --git a/tools/ci/build_test_apps.sh b/tools/ci/build_test_apps.sh index 171935be2..cce9c2dfe 100755 --- a/tools/ci/build_test_apps.sh +++ b/tools/ci/build_test_apps.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Build test apps # diff --git a/tools/ci/check-executable.sh b/tools/ci/check-executable.sh index eca5225b0..b40f5fa21 100755 --- a/tools/ci/check-executable.sh +++ b/tools/ci/check-executable.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # This script finds executable files in the repository, excluding some directories, # then prints the list of all files which are not in executable-list.txt. # Returns with error if this list is non-empty. diff --git a/tools/ci/check_examples_cmake_make.sh b/tools/ci/check_examples_cmake_make.sh index aa7d54058..53599dc19 100755 --- a/tools/ci/check_examples_cmake_make.sh +++ b/tools/ci/check_examples_cmake_make.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # While we support GNU Make & CMake together, check the same examples are present for both. But only for ESP32 diff --git a/tools/ci/check_examples_rom_header.sh b/tools/ci/check_examples_rom_header.sh index cf2cad922..d2e037510 100755 --- a/tools/ci/check_examples_rom_header.sh +++ b/tools/ci/check_examples_rom_header.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Examples shouldn't include rom headers directly diff --git a/tools/ci/check_idf_version.sh b/tools/ci/check_idf_version.sh index 36fdf003f..9a9ac4eae 100755 --- a/tools/ci/check_idf_version.sh +++ b/tools/ci/check_idf_version.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -u set -e diff --git a/tools/ci/check_ut_cmake_make.sh b/tools/ci/check_ut_cmake_make.sh index 34d5783f8..6f9c75471 100755 --- a/tools/ci/check_ut_cmake_make.sh +++ b/tools/ci/check_ut_cmake_make.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # While we support GNU Make & CMake together, check that unit tests support both CMAKE_UT_PATHS=$( find ${IDF_PATH}/components/ -type f -name CMakeLists.txt | grep "/test/" | grep -v "mbedtls/programs") @@ -16,4 +16,4 @@ if [ -n "$MISMATCH" ]; then fi echo "Unit tests match" -exit 0 \ No newline at end of file +exit 0 diff --git a/tools/ci/fix_empty_prototypes.sh b/tools/ci/fix_empty_prototypes.sh index 0aade7861..7ccf0e87b 100755 --- a/tools/ci/fix_empty_prototypes.sh +++ b/tools/ci/fix_empty_prototypes.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # This script finds and fixes up empty prototypes, to satisfy `-Wstrict-prototypes` and to сomply the C Standard diff --git a/tools/ci/get-full-sources.sh b/tools/ci/get-full-sources.sh index 18b0cd160..8ce0aecf2 100755 --- a/tools/ci/get-full-sources.sh +++ b/tools/ci/get-full-sources.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Now git submodules are redirected to mirror automatically according to relative URLs in .gitmodules diff --git a/tools/ci/get_supported_examples.sh b/tools/ci/get_supported_examples.sh index 1cae80b56..54cc47411 100755 --- a/tools/ci/get_supported_examples.sh +++ b/tools/ci/get_supported_examples.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -o errexit set -o pipefail set -o nounset diff --git a/tools/ci/mirror-submodule-update.sh b/tools/ci/mirror-submodule-update.sh index 18b0cd160..8ce0aecf2 100755 --- a/tools/ci/mirror-submodule-update.sh +++ b/tools/ci/mirror-submodule-update.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Now git submodules are redirected to mirror automatically according to relative URLs in .gitmodules diff --git a/tools/ci/multirun_with_pyenv.sh b/tools/ci/multirun_with_pyenv.sh index e8e23daa4..b7b44279b 100755 --- a/tools/ci/multirun_with_pyenv.sh +++ b/tools/ci/multirun_with_pyenv.sh @@ -1,4 +1,4 @@ -#! /bin/bash +#!/usr/bin/env bash # # Tool for running scripts with several versions of Python by the use of pyenv (versions must be installed before in # the docker image) diff --git a/tools/ci/push_to_github.sh b/tools/ci/push_to_github.sh index 6ea479ad6..1c3a343fd 100755 --- a/tools/ci/push_to_github.sh +++ b/tools/ci/push_to_github.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # gitlab-ci script to push current tested revision (tag or branch) to github diff --git a/tools/ci/setup_python.sh b/tools/ci/setup_python.sh index a0e1723be..4fc3d979f 100644 --- a/tools/ci/setup_python.sh +++ b/tools/ci/setup_python.sh @@ -1,4 +1,4 @@ -#! /bin/bash +#!/usr/bin/env bash # Regexp for matching job names which are incompatible with Python 3 # - assign_test, nvs_compatible_test, IT - auto_test_script causes the incompatibility diff --git a/tools/ci/test_build_system.sh b/tools/ci/test_build_system.sh index b8f5deac8..bc8632647 100755 --- a/tools/ci/test_build_system.sh +++ b/tools/ci/test_build_system.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Test the build system for basic consistency # diff --git a/tools/ci/test_build_system_cmake.sh b/tools/ci/test_build_system_cmake.sh index e4a277bd2..f15fdc367 100755 --- a/tools/ci/test_build_system_cmake.sh +++ b/tools/ci/test_build_system_cmake.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Test the build system for basic consistency (Cmake/idf.py version) # diff --git a/tools/ci/test_configure_ci_environment.sh b/tools/ci/test_configure_ci_environment.sh index 0cd4909c1..22e039362 100755 --- a/tools/ci/test_configure_ci_environment.sh +++ b/tools/ci/test_configure_ci_environment.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Short script to verify behaviour of configure_ci_environment.sh # diff --git a/tools/cmake/run_cmake_lint.sh b/tools/cmake/run_cmake_lint.sh index a21bc1168..3ba8b9c38 100755 --- a/tools/cmake/run_cmake_lint.sh +++ b/tools/cmake/run_cmake_lint.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Run cmakelint on all cmake files in IDF_PATH (except third party) # diff --git a/tools/docker/entrypoint.sh b/tools/docker/entrypoint.sh index bb1d3e65a..7cf15f191 100755 --- a/tools/docker/entrypoint.sh +++ b/tools/docker/entrypoint.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e . $IDF_PATH/export.sh diff --git a/tools/esp_app_trace/test/logtrace/test.sh b/tools/esp_app_trace/test/logtrace/test.sh index 35ba45405..1e24c0e30 100755 --- a/tools/esp_app_trace/test/logtrace/test.sh +++ b/tools/esp_app_trace/test/logtrace/test.sh @@ -1,4 +1,4 @@ -#! /bin/bash +#!/usr/bin/env bash { coverage debug sys \ && coverage erase &> output \ diff --git a/tools/esp_app_trace/test/sysview/test.sh b/tools/esp_app_trace/test/sysview/test.sh index a86bae42a..24dac9445 100755 --- a/tools/esp_app_trace/test/sysview/test.sh +++ b/tools/esp_app_trace/test/sysview/test.sh @@ -1,4 +1,4 @@ -#! /bin/bash +#!/usr/bin/env bash { coverage debug sys \ && coverage erase &> output \ diff --git a/tools/format-minimal.sh b/tools/format-minimal.sh index ff829247d..36787d22d 100644 --- a/tools/format-minimal.sh +++ b/tools/format-minimal.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Runs astyle with parameters which should be checked in a pre-commit hook astyle \ --style=otbs \ diff --git a/tools/format.sh b/tools/format.sh index 5db80caeb..e9b8b2dd3 100755 --- a/tools/format.sh +++ b/tools/format.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Runs astyle with the full set of formatting options astyle \ --style=otbs \ diff --git a/tools/kconfig/lxdialog/check-lxdialog.sh b/tools/kconfig/lxdialog/check-lxdialog.sh index 72bed5f17..0d0ecb0d1 100755 --- a/tools/kconfig/lxdialog/check-lxdialog.sh +++ b/tools/kconfig/lxdialog/check-lxdialog.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Check ncurses compatibility if [ "$OSTYPE" != "msys" ]; then diff --git a/tools/set-submodules-to-github.sh b/tools/set-submodules-to-github.sh index 5495fb4a2..85c057639 100755 --- a/tools/set-submodules-to-github.sh +++ b/tools/set-submodules-to-github.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Explicitly switches the relative submodules locations on GitHub to the original public URLs # diff --git a/tools/test_idf_size/test.sh b/tools/test_idf_size/test.sh index 806e5e235..11d96b4ef 100755 --- a/tools/test_idf_size/test.sh +++ b/tools/test_idf_size/test.sh @@ -1,4 +1,4 @@ -#! /bin/bash +#!/usr/bin/env bash { coverage debug sys \ && coverage erase &> output \ diff --git a/tools/unit-test-app/tools/get_available_configs.sh b/tools/unit-test-app/tools/get_available_configs.sh index c5161bd29..3be9e5864 100755 --- a/tools/unit-test-app/tools/get_available_configs.sh +++ b/tools/unit-test-app/tools/get_available_configs.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash cd ${IDF_PATH}/tools/unit-test-app diff --git a/tools/windows/eclipse_make.sh b/tools/windows/eclipse_make.sh index 769bca269..d7b26b950 100755 --- a/tools/windows/eclipse_make.sh +++ b/tools/windows/eclipse_make.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash echo "eclipse_make.sh has been replaced with eclipse_make.py. Check the Windows Eclipse docs for the new command." echo "This shell script will continue to work until the next major release." python ${IDF_PATH}/tools/windows/eclipse_make.py $@ diff --git a/tools/windows/tool_setup/build_installer.sh b/tools/windows/tool_setup/build_installer.sh index b3e089cc1..3364ec0bb 100755 --- a/tools/windows/tool_setup/build_installer.sh +++ b/tools/windows/tool_setup/build_installer.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Script to build the IDF Tools installer for Windows with Inno Setup. # This script should be executed inside wine-innosetup docker image. diff --git a/tools/windows/tool_setup/sign_installer.sh b/tools/windows/tool_setup/sign_installer.sh index 59298edf3..25efffe37 100755 --- a/tools/windows/tool_setup/sign_installer.sh +++ b/tools/windows/tool_setup/sign_installer.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Script to sign the IDF Tools installer for Windows, built with build_installer.sh. # diff --git a/tools/windows/windows_install_prerequisites.sh b/tools/windows/windows_install_prerequisites.sh index b72529173..83731e2e9 100644 --- a/tools/windows/windows_install_prerequisites.sh +++ b/tools/windows/windows_install_prerequisites.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Setup script to configure an MSYS2 environment for ESP-IDF. #