Skip to content

Files

bash

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
May 13, 2023
Mar 9, 2022
Dec 15, 2021
Aug 30, 2022
Oct 14, 2023
Apr 15, 2020
Apr 15, 2020
Jan 10, 2024
Jan 21, 2024
Jan 21, 2024
Aug 30, 2022
Aug 30, 2022
Aug 30, 2022
Aug 30, 2022
Oct 9, 2024
Feb 2, 2024
Jan 10, 2024
Feb 18, 2023
Feb 10, 2022
Feb 10, 2022
Jan 1, 2024
Mar 7, 2022
Dec 18, 2023
Feb 10, 2022
Feb 10, 2022
Feb 10, 2022
Feb 19, 2023
Feb 10, 2022
Jan 28, 2025
Aug 17, 2021
Feb 10, 2022
Jan 13, 2022
Feb 28, 2022
Aug 17, 2021
Jul 4, 2022
Dec 14, 2021
Nov 18, 2022
Mar 31, 2024
May 13, 2023
Feb 28, 2022
Oct 9, 2024
Feb 10, 2022
Feb 2, 2023
May 13, 2023
Feb 3, 2023
Mar 14, 2023
Oct 10, 2022
May 13, 2023
Feb 17, 2022
Nov 18, 2022
Jan 13, 2022
Feb 2, 2023
Feb 10, 2022
Feb 17, 2022
Feb 10, 2022
Feb 10, 2022
Feb 10, 2022
Mar 19, 2022
Jun 24, 2023
Jun 24, 2023
Jun 24, 2023
Sep 9, 2023
Sep 9, 2023
Feb 3, 2023
Feb 2, 2023
Aug 17, 2021
Oct 14, 2023
Oct 14, 2023
Nov 18, 2022
Dec 30, 2022

This file is part of eRCaGuy_hello_world: https://github.com/ElectricRCAircraftGuy/eRCaGuy_hello_world

Other pages

  1. ansi_text_format_lib_README.md

Notes

wip means "work-in-progress".

Shellcheck

Use the shellcheck static code analyzer to analyze your bash scripts for errors before running them. Learn a little bit more about shellcheck in this answer which helped me here: Stack Overflow: How to write bash function to print and run command when the command has arguments with spaces or things to be expanded.

# Install shellcheck
sudo apt update && sudo apt install shellcheck 

# Use it to scan a bash .sh program
shellcheck path/to/my_script.sh

If you ever need to disable a shellcheck warning or error, see here: https://github.com/koalaman/shellcheck/wiki/Ignore. The syntax would look like this. The # shellcheck disable=SC2059 syntax is what disables that shellcheck error code on the line immediately following it.

hexToAscii() {
  # shellcheck disable=SC2059
  printf "\x$1"
}

For a info. on the shellcheck "check" errors, per their codes, see here: https://github.com/koalaman/shellcheck/wiki/Checks
A full list is here: https://gist.github.com/nicerobot/53cee11ee0abbdc997661e65b348f375 Example page: https://github.com/koalaman/shellcheck/wiki/SC1000

bash script generic templates:

For an excellent bash script template, see these files as a starting points:

  1. [BEST] argument_parsing__3_advanced__gen_prog_template.sh
  2. https://github.com/ElectricRCAircraftGuy/eRCaGuy_dotfiles/blob/master/useful_scripts/git-disable-repos.sh
  3. Another good example: my pdf2searchablepdf bash script:
    1. Repo: https://github.com/ElectricRCAircraftGuy/PDF2SearchablePDF
    2. Exact bash script file: https://github.com/ElectricRCAircraftGuy/PDF2SearchablePDF/blob/master/pdf2searchablepdf.sh
  4. git-blametool.sh