Effective Shell is an ebook on shell scripting principles1.
unix-shell-script-tactics is a shell style guide that lays out common script patterns.
ShellCheck is a linter for shell scripts.
dylanaraps/pure-sh-bible - A collection of pure POSIX sh alternatives to external processes.
Appending multiple lines to a file
tee -a FILE << EOF > /dev/null
echo "line 1"
echo "line 2"
EOFStart custom scripts with ’,’
If you create custom scripts in a PATH’d bin directory, prepend them with a , to keep them separate from the standard binaries and also allow easy access via tab completion2.
Get path relative to script path
script_root = $(dirname $(realpath $0))1.
Kerr, D. Effective Shell. (2022).
2.
Rhodes, B. Start All of Your Commands with a Comma. https://rhodesmill.org/brandon/2009/commands-with-comma/?utm_medium=email (2009).