A repo of useful libraries that I've been creating through the years to make bash scripting duties easier.
(Yes, I know, zsh
exists and all, but its not the point, feel free to adapt).
Most of those scripts are kept up-to-date at various times but I try to maintain it to date with latest bash versions.
Each proposed library has its own documentation, read it carefully before using them.
- executables destined to help use this library.
- libraries (to be sourced).
- packages (to be sourced).
- some completion scripts (incl. for some previous items listed, to be sourced).
- animation scripts (to be sourced).
- ... and launchers for those animations to have a preview and how to use them (kind of).
- utility scripts (incl
debug.sh
and bash unit testing framework). - Third party software helpers (
tools-lib
) to add extra commands to them or ease their use (to be sourced). - some wild bash tests to be kept for information and posterity.
- some miscellaneous tools.
All scripts dependencies are written down in their documentation.
Some scripts are sourcing some other files from this library, making them unusable as-is, but you can use the tool package_scripts.sh
to compile a standalone version.
All scripts that have sourced files are taking them from this library, and this library only, but using the defined variables from the profiles provided in the bin
directory.
Please check the usage section for more information.
bin
executables to help using this repo.animations
executables to showcase the animation source files.
man
manual pages.src
directory containing all source files. None of them are executables.animation
bash animations in order to prettify waiting for other processes.awk
awk source filescompletion
completion files for somelib
orpackages
.lib
core source files of this library, each file contains a method of the same name and maybe some quality-of-life shortcuts.packages
core source files of this library for frameworks and bigger libraries that contain more than one method.
test
unit tests for the source files (libs and packages insrc
).tools
random tools for every day life as executables. Some can use sources from this repo.tools-lib
sources for quality of life regarding every day CLI softwares.utils
utilitaries files that are used in this repo. This is where you can find thedebug.sh
script which helps you dumping bash variables.wild
wild bash tests for posterity and bash/console behaviours.
Everything in the libraries and packages has been unit tested (as much as one can with bash) and can be checked from the ./bin/launcher.sh
.
All development and testing is done using Cygwin, give me a shout if something is not working on standard Linux platforms (feel free to open an issue).
- File
launcher.sh
allows to run all/some unit tests or get the list. - File
source_libs.sh
allows to source all libs and completion files. .launcher_profile
(and itssafe
counterpart) allow to dynamically create environment variables to use all libs in this repo.- The
safe
version prevents from overriding your own environment, but does not output any error. It is sourced in bothlauncher.sh
andsource_libs.sh
files.
- The
A small excerpt from my .bashrc
to use this repo:
export SH_PATH=~/scripts/main
source "$SH_PATH/bin/source_libs.sh"
alias reload='source ~/.bashrc'
alias bashtest='$SH_PATH/bin/launcher.sh'
Each file should have its own documentation and some man pages are being created (when time allows).
The only contributor and author is Sylvain "Sylordis" Domenjoud.
This project is distributed under the DBAD license.
Please report any bug you find at bash-library repo issues.
Have fun, stay scripty!