Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/client9/shlib
portable functions for posix shell environments
https://github.com/client9/shlib
Last synced: 13 days ago
JSON representation
portable functions for posix shell environments
- Host: GitHub
- URL: https://github.com/client9/shlib
- Owner: client9
- License: unlicense
- Created: 2017-05-11T23:48:46.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-05-18T05:16:06.000Z (6 months ago)
- Last Synced: 2024-10-16T14:59:05.699Z (26 days ago)
- Language: Shell
- Size: 71.3 KB
- Stars: 363
- Watchers: 8
- Forks: 36
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- jimsghstars - client9/shlib - portable functions for posix shell environments (Shell)
README
# shlib
portable functions for posix shell environments[![Build Status](https://travis-ci.org/client9/shlib.svg?branch=master)](https://travis-ci.org/client9/shlib)
I've sadly written a lot of shell scripts. Mostly for installers on
completely alien environments.Really shell code should only be used for boot-strapping to something sane. Until then you might need some truly portable functions. I hope you never need to use them, but if you do they are [public domain](http://unlicense.org). Do whatever you'd like with them.
However acknowledgement (and pull requests) are appreciated. You can optionally include [license.sh](license.sh) so the next person knows where to find them.
## Usage
Here's an example of how create and compress a custom set of functions. Using `grep -v '^#' | grep -v ' #' | tr -s '\n'` strips away comments and blank lines.
```bash
cat \
license.sh \
is_command.sh \
uname.sh \
untar.sh \
mktmpdir.sh \
http_download.sh \
hash_sha256.sh \
license_end.sh | \
grep -v '^#' | grep -v ' #' | tr -s '\n'
```## WIP
Some of these are new, some are these are pulled from old code I wrote. All can definitely be
improved. Pull requests very welcome:* Simplify
* Clean up local variable use
* Remove any "exit 1" I may have left behind## Testing
I'm unlikely to work on this in the short term, but.. someone, someday could:
* Probably write the test harness in go, not shell.
* Using travis.ci we can definite test ubuntu, centos and alpine/busybox using docker
* Can we test macOS on travis? They support something here but unclear how it works.## Documentation
I've start to write doco in Markdown as shell comments. The plan would be to extract it to standalone markdown so it would display on GitHub.