Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dzove855/bash-loadables-rust
Some bash loadables written in rust
https://github.com/dzove855/bash-loadables-rust
Last synced: 16 days ago
JSON representation
Some bash loadables written in rust
- Host: GitHub
- URL: https://github.com/dzove855/bash-loadables-rust
- Owner: dzove855
- Created: 2022-07-06T12:18:31.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-04T17:43:54.000Z (10 months ago)
- Last Synced: 2024-03-04T19:21:29.743Z (10 months ago)
- Language: Rust
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bash loadables builtins in rust
Json Encode/Decode -> bash-json-plugin
Expr -> arithmethic expression
NOTE: It's all still experimental to learn Rust
## Json Parser
NOTE: For the moment only decode is working.
compile:
```
cd json-builtin; cargo build
```
Move the target file where ever you want and then just enable it inside your script:
```
enable -f target/debug/libjson_builtin.so jsontest='{"testing": "hehe", "blob": "triiiiiiiii", "tik": {"muu": "haa", "tut": {"blea": "nek"}}, "mip": "fi", "nik": {"blik": "nek", "lorem": "ipsum", "candy": "handy"}, "michael": "jordan"}'
json -v exported -d test -D .
#Output of exported
declare -A exported=([nik.candy]="handy" [tik.muu]="haa" [nik.blik]="nek" [blob]="triiiiiiiii" [michael]="jordan" [mip]="fi" [nik.lorem]="ipsum" [testing]="hehe" [tik.tut.blea]="nek" )
```
Help Example:
```
Options:
-e Encode.
-d Decode.
-v Variable to assign (Default: JSON)
-D Delimeter (Default: :)
```## Expr
compile:
```
cd expr; cargo build
```
Move the target file where ever you want and then just enable it inside your script:
```
enable -f target/debug/libexpr_builtin.so exprexpr -v result "2/3"
echo $result
```
Help Example:
```
Options:
-v Variable to assign (Default: RESULT)
```