Wiki.
- Best Practices for Writing Bash Scripts (kvz.io).
- Use the Unofficial Bash Strict Mode (Unless You Looove Debugging (redsymbol.net)
- kvz/bash3boilerplate
# Define error reporting level, file seperator, and init direcotry.
function init(){
set -Eeuo pipefail; # set -o xtrace;
IFS=$'\n\t'
DIR=$PWD;
ROOT_DIR="$(dirname "${DIR}")";
}
init
Comment out the set -Eeuo pipefail.
- Create a launcher.
- Set working directory and command.
- Check 'Open in terminal'.
- epety/100-shell-script-examples.
- natelandau/shell-scripts.
- Netbeans 8.2 installer. It is a ~ 120 MB large shell script. You can download it
here.
It contains
functions
,ifs
,loops
and so on.
man bash
.- Advanced Bash-Scripting Guide from The Linux Documentation Project.
- Say what? Kipibenkipod view of the world.
- Naming_Conventions.
- Defensive BASH Programming.
- nbshell plugin for Netbeans.
- isao/shell - various scripts and support files for noodling on the command line, esp bbedit, git, etc
- xbot/shell - This repo hosts miscellaneous scripts I use in my daily life.
- smilejay/shell - some of Jay's shared Shell codes. http://smilejay.com
- hjxhjh/shell - some of my shared shell scripts
- Crabbit/shell - My shell scripts.
- geekcomputers/Shell - Some of the handy shell scripts I have created/acquired
- dl - fetch remote file for convenient local reading
- Remember to add backslash '' for special symbols in texts. Example,
echo "I
don'twant it."
will raise errordon't: command not found
and the output will becomeI want it.
. Noticed this when pushing a commit and some of the text was missing because I used `` to highlight a code. - Shell scripts are very strict about spaces so
if[[ ... ]]
won't work because afterif
there should be a space.
-
set -x
for debug. More in learn-basics/debug.sh. -
use
exit
to stop the script. -
Better write outpout to file with echo -e, otherwise the output in terminal can be misleading.
Started in Jan 2018