An open API service indexing awesome lists of open source software.

https://github.com/hpehl/bash-template

Bash template heavily inspired by https://betterdev.blog/minimal-safe-bash-script-template/
https://github.com/hpehl/bash-template

bash template

Last synced: about 2 months ago
JSON representation

Bash template heavily inspired by https://betterdev.blog/minimal-safe-bash-script-template/

Awesome Lists containing this project

README

          

# Bash Template

Bash template heavily inspired by https://betterdev.blog/minimal-safe-bash-script-template/

## Basic Features

- fail-safe
- basic parsing of (required) flags, options and arguments
- version (-v, --version)
- usage (-h, --help)
- colorful / plain text output (--no-color)
- `cleanup()`, `msg()` and `die()` function

## Get Started

Just copy & paste `script.sh` and adjust to your needs.

## Resources

These resources might also help in writing better shell / bash scripts:

- [Command Line Interface Guidelines](https://clig.dev/)
- [The Art of Command Line](https://github.com/jlevy/the-art-of-command-line)
- [Shell Scripts Matter](https://blog.thibaut-rousseau.com/2017/12/03/shell-scripts-matter.html)
- [12 Factor CLI Apps](https://medium.com/@jdxcode/12-factor-cli-apps-dd3c227a0e46)
- [ShellCheck](https://www.shellcheck.net/)
- [explainshell.com](https://explainshell.com/)