Bash Boilerplate Generator

What is this?

  • Use this page to quickly generate a bash boilerplate script with option parsing, verbose/quiet mode, ask for confirmation ...
  • Fill in your email, the flags/options/parameters you need • press «Generate» • copy the code • paste it in your editor. • Now start coding the main part of the script
  • Bash scripts will run on: Linux (Ubuntu/Debian), Busybox (Synology/QNAP), MacOS,

Customize

script.sh --flag1 --flag2 --option1 val1 --option2 val2 param1 param2 multi(s)
A flag is an optional on/off parameter like -d/--debug.
An option is a optional value parameter like -e/--email [email].
An param is an obligatory unnamed value parameter.

BASH BOILERPLATE

Based on bash-boilerplate by pforret

References

  • If you often write small bash scripts to automate/facilitate repeating tasks, you don't want to lose time re-implementing option parsing, debug messages, OS detection, confirmation questions. I've been using this boilerplate bash code since 2017. The only thing missing was a configurable code generator. And here it is!