Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wick3dr0se/bashin
A minimal BASH framework
https://github.com/wick3dr0se/bashin
bash framework interpreter library script
Last synced: about 2 months ago
JSON representation
A minimal BASH framework
- Host: GitHub
- URL: https://github.com/wick3dr0se/bashin
- Owner: wick3dr0se
- License: gpl-3.0
- Created: 2022-06-18T04:34:40.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-12T06:37:35.000Z (11 months ago)
- Last Synced: 2024-02-13T08:16:33.969Z (11 months ago)
- Topics: bash, framework, interpreter, library, script
- Language: Shell
- Homepage:
- Size: 146 KB
- Stars: 13
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Bashin is an extension of BASH intended to be as minimal and clean as possible; Wrote in pure BASH, bashin is super fast
Many scripters resort to slow external commands glued together with pipes and subshells. Of course they have their use cases but generally (for performance sake) they should be avoided
Bashin supports push, pop, cycling arrays and many more array/stack operations. Bashin handles ANSI escape sequences that make coloring, positioning and other terminal modifications much more simple (like building a TUI)
```bash
push 'a' 'b' 'c'echo "${STACK[@}"
```> a b c
```bash
stack -recho "${STACK[@]}"
```> c b a
```bash
arr=('a' 'b' 'c')reverse_array "${arr[@]}"
echo "${REVERSE[@]}"
```> c b a
```bash
arr1=('a' 'b' 'c') arr2=('a' 'c')unique "${arr1[*]}" "${arr2[*]}"
echo "${UNIQUE[@]}"
```> b
— Among many other things; Bashin can be sourced interactively or per script
# Auto Setup
execute the setup.sh script (recommended)```bash
bash <(curl -s https://raw.githubusercontent.com/wick3dr0se/bashin/main/setup.sh)
```*the one-liner above will remotely execute the `bashin` setup script - including `bashin`*
## Manual Setup
clone the repository
```bash
git clone https://github.com/wick3dr0se/bashin&& cd "${_##*/}"
```execute the setup.sh script `bash setup.sh`
otherwise source bashin within another script:
```bash
/bashin
# or
. /bashin
```source within your ~/.bashrc to use interactively & globally
then use `import_all` or `import` to manually source necessary procs (functions), e.g. `import ansi`
*core libs (scripts) are implicitly imported*
# How to Use
See `usage.sh` for examples and view documentation in the respective library directory