https://github.com/patrickduncan/shunc
A universal utility library for shell scripting
https://github.com/patrickduncan/shunc
posix posix-compatible posix-compliant posix-sh shell utility utility-library
Last synced: 4 months ago
JSON representation
A universal utility library for shell scripting
- Host: GitHub
- URL: https://github.com/patrickduncan/shunc
- Owner: PatrickDuncan
- License: gpl-3.0
- Created: 2018-08-18T18:57:24.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-18T03:56:25.000Z (almost 7 years ago)
- Last Synced: 2025-02-10T22:49:19.564Z (8 months ago)
- Topics: posix, posix-compatible, posix-compliant, posix-sh, shell, utility, utility-library
- Language: Shell
- Homepage:
- Size: 25.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# shunc
[](https://travis-ci.org/PatrickDuncan/shunc)
The goal of this library is to make shell scripting easier for everyone. Your shell of preference should not matter!
This script will not change the state of your variables. Meaning that if a function needs to declare a variable it will save the previous value and reset the variable's value after execution.
## Installation
1. Generate the script:
```
./bin/generate
```
2. The script will be in _dist_, move it into your own project.
3. Add this to the beginning of your script:
```
. /shunc
```## Examples
```sh
#!/bin/sh. $HOME/dev/password_check/lib/shunc
[ "$(_length $1)" -gt 8 ] && echo PASS || echo FAIL
```## Documentation
You can find documentation for the various functions on the [wiki](https://github.com/PatrickDuncan/shunc/wiki).
## Linting
```
docker run -e SHELLCHECK_OPTS="-e SC1091" -v "$PWD:/mnt" koalaman/shellcheck
```## Testing
##### Prerequisite(s)
* Follow [Retrieve all submodules](#retrieve-all-submodules)
##### All tests
```
./bin/run_tests
```
##### Single test
```
sh
```### Submodules
##### Retrieve all submodules
```
git submodule update --remote --recursive --init
```