Fork me on GitHub
Table of contents

Bashinator: Bash Shell Script Framework

Bashinator is a framework for bash shell scripts.

Features

Quickstart

On Gentoo Linux:

# add the wschlich overlay
layman -a wschlich
# install bashinator
emerge bashinator
# install the bashinator example application from the doc directory to the standard location
install -D -o root -g root -m 0644 /usr/share/doc/bashinator-*/example/bashinator.cfg.sh /etc/example/bashinator.cfg.sh
install -D -o root -g root -m 0644 /usr/share/doc/bashinator-*/example/example.cfg.sh /etc/example/example.cfg.sh
install -D -o root -g root -m 0644 /usr/share/doc/bashinator-*/example/example.lib.sh /usr/share/example/example.lib.sh
install -D -o root -g root -m 0755 /usr/share/doc/bashinator-*/example/example.sh /usr/bin/example.sh
# run the example script
/usr/bin/example.sh -a

On any other Linux:

# download a bashinator release and unpack the package
wget -O bashinator-0.6.1.tar.gz https://github.com/wschlich/bashinator/archive/0.6.1.tar.gz
tar -xzvf bashinator-0.6.1.tar.gz
# install the bashinator library to the standard location
install -D -o root -g root -m 0644 bashinator-*/bashinator.lib.0.sh /usr/share/bashinator/bashinator.lib.0.sh
# install the bashinator example application from the doc directory to the standard location
install -D -o root -g root -m 0644 bashinator-*/example/bashinator.cfg.sh /etc/example/bashinator.cfg.sh
install -D -o root -g root -m 0644 bashinator-*/example/example.cfg.sh /etc/example/example.cfg.sh
install -D -o root -g root -m 0644 bashinator-*/example/example.lib.sh /usr/share/example/example.lib.sh
install -D -o root -g root -m 0755 bashinator-*/example/example.sh /usr/bin/example.sh
# run the example script
/usr/bin/example.sh -a

Documentation

A typical Bashinator-based application file layout looks like this:

# bashinator configuration file
/etc/myapplication/bashinator.cfg.sh
# application configuration file
/etc/myapplication/myapplication.cfg.sh
# application library file containing __init(), __main() and other user defined functions
/usr/share/myapplication/myapplication.lib.sh
# executable application script file based on bashinators example.sh
/usr/bin/myapplication.sh

A typical Bashinator-based application script structure looks like this (see example.sh):

Source and Downloads

Screenshots

Messages of example.sh printed on terminal:

Messages of example.sh sent via mail:

Projects based on Bashinator

Bashinator on the web

Other bash/shell frameworks

There's also a list of bash frameworks/libraries put together by Donnie Berkholz.

Contact/Imprint

This website is operated by Wolfram Schlich, Höhenweg 45A, 53347 Alfter, Germany

Business/consulting inquiries: wolfram.schlich.biz


Last modified: 07. October 2020, 16:58:15 by Wolfram Schlich <wschlich*AT*gentoo*DOT*org>