Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sdelements/shtdlib
Shell Standard Library
https://github.com/sdelements/shtdlib
Last synced: about 2 months ago
JSON representation
Shell Standard Library
- Host: GitHub
- URL: https://github.com/sdelements/shtdlib
- Owner: sdelements
- License: mit
- Created: 2018-05-28T14:58:59.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-24T23:24:36.000Z (almost 2 years ago)
- Last Synced: 2024-03-26T02:14:18.171Z (9 months ago)
- Language: Shell
- Homepage:
- Size: 568 KB
- Stars: 9
- Watchers: 36
- Forks: 3
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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-betaSupport for bash 3.1 has bene deprecated.
## Installation
For an example of how to install/import see:
```bash
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:```bash
git clone --recurse-submodules https://github.com/sdelements/shtdlib.git
```Or if you've already cloned this project you can initialize and pull using:
```bash
git submodule init
git submodule update --recursive
```### Test Examples:
- all supported versions (using docker containers)
```bash
source shtdlib.sh && test_shtdlib
```- local bash only, no containers
```bash
source shtdlib.sh && test_shtdlib local
```- specific bash version(s) and/or local
```bash
source shtdlib.sh && test_shtdlib 3.2.57 4.4.23 local
```