/shell-boilerplate

Bash Boilerplate

Primary LanguageShellMIT LicenseMIT

Shell Boilerplate Code Climate

Shell Boilerplate

How to use

Instalation

wget https://raw.githubusercontent.com/yvoronoy/shell-boilerplate/master/script.sh

How create custom action

Usage: script.sh [action name] [--options] []

You can specify your own action for example helloworld

helloworldAction()
{
  echo "Hello World!";
}

and run it script.sh helloworld That's it.

Code Style

  • Use two spaces instead tab.
  • Use ; at the end of line.
  • Use {} to enclose your variables.
  • Use :- if you want to test variables that could be undeclared. For instance, with if [ "${NAME:-}" = "Kevin" ], $NAME will evaluate to Kevin if the variable is empty. The variable itself will remain unchanged. The syntax to assign a default value is ${NAME:=Kevin}.

Resources