Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

antevens/shtdlib

Open more actions menu
 
 

Repository files navigation

shtdlib

Shell Standard Library

Compatibility

Supported bash versions currently include the following though not all functions will be supported on all versions.

  • 3.2.57
  • 4.0.44
  • 4.1.17
  • 4.2.53
  • 4.3.48
  • 4.4.23
  • 5.0-beta

Support for bash 3.1 has bene deprecated.

Installation

For an example of how to install/import see:

import_install_example.sh

Common settings

Variables/Options which can be set/exported to change the behaviour of the library and various functions during execution.

  • interactive - true/false - en/dis-ables interactive promps and features requiring a TTY/PTY
  • strict_mode - true/false - en/dis-ables shell options to stop and/or exit on errors and undefined variables
  • verbosity - 0-10 - Sets the verbosity for debug logging, default 0

Testing

For testing bash code across multiple versions of bash we highly recommend using the bashtester submodule, you can pull it with this repository by using:

git clone --recurse-submodules https://github.com/sdelements/shtdlib.git

Or if you've already cloned this project you can initialize and pull using:

git submodule init
git submodule update --recursive

Test Examples:

  • all supported versions (using docker containers)

    source shtdlib.sh && test_shtdlib
  • local bash only, no containers

    source shtdlib.sh && test_shtdlib local
  • specific bash version(s) and/or local

    source shtdlib.sh && test_shtdlib 3.2.57 4.4.23 local

About

Shell Standard Library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Shell 100.0%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.