Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yvoronoy/shell-boilerplate
Bash Boilerplate
https://github.com/yvoronoy/shell-boilerplate
Last synced: 2 months ago
JSON representation
Bash Boilerplate
- Host: GitHub
- URL: https://github.com/yvoronoy/shell-boilerplate
- Owner: yvoronoy
- License: mit
- Created: 2016-10-17T11:55:58.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-10-26T03:00:14.000Z (about 8 years ago)
- Last Synced: 2024-08-01T13:36:47.733Z (5 months ago)
- Language: Shell
- Size: 4.88 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ccamel - yvoronoy/shell-boilerplate - Bash Boilerplate (Shell)
README
# Shell Boilerplate [![Code Climate](https://codeclimate.com/github/yvoronoy/shell-boilerplate/badges/gpa.svg)](https://codeclimate.com/github/yvoronoy/shell-boilerplate)
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
- [Best Practices for Writing Bash Scripts](http://kvz.io/blog/2013/11/21/bash-best-practices/)