Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hayao0819/fasbashlib

A collection of many personal functions for modern Bash
https://github.com/hayao0819/fasbashlib

arch-linux bash bash-script library linux shell shell-script shellscript

Last synced: 3 months ago
JSON representation

A collection of many personal functions for modern Bash

Awesome Lists containing this project

README

        

## FasBashLib - A collection of many personal functions for modern Bash























A collection of many personal functions for modern Bash to write safe and readable code quickly

They are grouped by function type, and some functions are specific to a particular system.

I like Arch Linux, so there may be many for it.

## Features
These are only part of FasBashLib's main libraries.

- Supports 3 coding styles, `Upper camel case` , `Lower camel case`, and `Snake case`
- Select and build only the functions you need
- Automatically generate documents from source code comments
- Unique test tool specially designed
- Safe and easy array operation (`Array`)
- Batch analysis of URLs from standard input (`URL`)
- Arch Linux-specific functions (`Aur`, `ArchLinux`, `Pacman`, `SrcInfo`)

## Why?

Modern Bash is feature-rich, making it possible to write secure code compared to pure shells.

If you are coding utilizing these features, you will find yourself writing the same code over and over again.

Also, Bash has no type restrictions, so even something as simple as evaluating boolean values can become redundant if you consider safety.

This library has many functions, especially for arrays, that make it easy to write safe code that takes special characters such as whitespace into account.

Furthermore, shell scripts currently lack a system for managing and loading libraries in a consistent manner.

FasBashLib is modular and assists in adding and removing functions and loading them in various environments.

If you want to add your own functions, fork this project and place your shell scripts in src.

Testing, documentation generation, local installation, and dynamic loading from online are all supported.

## Use it

See [How to use it](./docs/USE.md)

## Document

You can read the latest auto generated documents [here](https://github.com/Hayao0819/FasBashLib/tree/build-0.2.x/docs/lib).

Or download document from [Release Page](https://github.com/Hayao0819/FasBashLib/releases)

## Test

See [How to test](./docs/TEST.md)

## Code examples

You can add your script to this list. Please send a Pull request.

- [10 Number Game](https://gist.github.com/Hayao0819/caad8ef3952bdfef7287ef8c5d71e03c) - A simple game about math
- [ArchNews.sh](https://gist.github.com/Hayao0819/897be45dfedb0aa4fcc2735a0831966f) - Show the latest Arch Linux news
- [Hayao0819/MisskeyBot](https://github.com/Hayao0819/MisskeyBot) - A Misskey Bot to renote automatically

## Special thanks

FasBashLib is composed of these projects. Deepest thanks to their contributors!

- [agners/archlinuxarm-docker](https://github.com/agners/archlinuxarm-docker) - Arch Linux ARM Docker images
- [ko1nksm/readlinkf](https://github.com/ko1nksm/readlinkf) - The functions in `Readlink.sh` are taken from this repository.
- [reconquest/shdoc](https://github.com/reconquest/shdoc) - Script to generate documentation from source code
- [Zuzzuc/Bash-minifier](https://github.com/Zuzzuc/Bash-minifier) - Script used to minify bash scripts
- [mvdan/sh](https://github.com/mvdan/sh) - `Build-Single.sh` formats the generated scruples using shfmt.
- [ShellShoccar-jpn/Parsrs](https://github.com/ShellShoccar-jpn/Parsrs) - Simple parsers written in POSIX shell (for `Parsrs`)
- [shimataro/ssh-key-action](https://github.com/shimataro/ssh-key-action) - Auto build and update with GitHub Action
- [softprops/action-gh-release](https://github.com/softprops/action-gh-release) - Make new release from tag with GitHub Action
- [mfinelli/setup-shfmt](https://github.com/mfinelli/setup-shfmt) - Setup shfmt and run it on GitHub Action
- [watasuke102/MIT-SUSHI-WARE](https://github.com/watasuke102/mit-sushi-ware) - MIT-derived license that only wants copyright notice and sushi