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/
- Host: GitHub
- URL: https://github.com/hpehl/bash-template
- Owner: hpehl
- License: apache-2.0
- Created: 2022-09-14T10:38:09.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-09-14T10:41:00.000Z (almost 4 years ago)
- Last Synced: 2025-03-17T15:55:48.751Z (over 1 year ago)
- Topics: bash, template
- Language: Shell
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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/)