Bash Shell
- The Art of Command Line (HN)
- Bash-Oneliner
- Shell Script Best Practices, Shrikant Sharat Kandula (HN)
- Apparently the Advanced Bash Scripting guide is considered full of bugs, as per the #bash community on Libera.chat.
Useful tips:
- You can split on input by specifying an
internal field separator
(IFS), then reading in content via the
read
command.IFS=';' read -ra ADDR <<< "$IN"
for i in "${ADDR[@]}"; do
# process "$i"
done - ShellCheck,
(GitHub) can be used as a linter for
shell scripts.
- The ShellCheck Wiki provides all of the rules, explanations for why, and examples for the rules checked by ShellCheck