Skip to content
/ bashly Public

Bashly is a collection of solutions to common problems that arise when writing scripts in the bash shell. You can call it a library. Just keep in mind that reusable bash code is hard, so it might not be that pretty to use. It's focused on bash versions greater or equal to 4.

License

Notifications You must be signed in to change notification settings

dualbus/bashly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bashly
======

This project, bashly, is yet another attempt of a library of reusable
bash functions. Though its development is driven by the following
core principles:

- Encapsulate all state within the functions (no global variables)
- Avoid ''eval'' at all costs. It is really hard to read scripts that
  (ab)use eval, and even more difficult to maintain. There are also
  security risks associated to the use of eval.
- Avoid external commands, bashly attempts to be standalone. The only
  commands that are going to be used are: od (it's POSIX, and to
  overcome the binary stream handling of bash). This should make it
  very portable across systems where bash is available.
- Lots of tests. Code should be written with testability in mind.
- Follow best practices for bash programming.
- Make it easy to create stand-alone scripts that are linked to the
  bashly modules, but also make it easy to update linked scripts.


The modules (or libraries) reside in the lib/ hierarchy. They have
the bashly extension, to easily identify them as libraries. Each
library should have its own battery of tests under the test/
hierarchy. Also, each library should have its own documentation under
docs/lib.

You will find sample scripts based on bashly under the src/
directory, with their "linked" forms under bin/


Feed-back in the form of issues is greatly appreciated.

About

Bashly is a collection of solutions to common problems that arise when writing scripts in the bash shell. You can call it a library. Just keep in mind that reusable bash code is hard, so it might not be that pretty to use. It's focused on bash versions greater or equal to 4.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published