Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kekepower/zini
A Zsh INI file reader
https://github.com/kekepower/zini
ini ini-reader shell shell-functions shell-script zsh zsh-function
Last synced: about 11 hours ago
JSON representation
A Zsh INI file reader
- Host: GitHub
- URL: https://github.com/kekepower/zini
- Owner: kekePower
- License: gpl-3.0
- Created: 2024-02-21T12:56:34.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-02-23T22:12:16.000Z (9 months ago)
- Last Synced: 2024-02-24T17:43:54.458Z (9 months ago)
- Topics: ini, ini-reader, shell, shell-functions, shell-script, zsh, zsh-function
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# zini
A Zsh INI file reader.I created this Zsh function as part of my [Quick Site Generator 2](https://github.com/kekePower/qsgen2) script to read the config file.
### Example INI file
```
; This is a comment
[section]
name = value[other_section]
name = value
```### Usage
Place the file ```zini``` in your ```fpath``` and use Zsh's ```autoload``` to load the function.
```
#!/usr/bin/zsh# You can also add your own paths to fpath
# and place zini there.
fpath=(${HOME}/zsh-functions $fpath)
autoload zini
zini /path/to/your/ini-file
```Then you can fetch the values like this
```
${config[section_name]}
${config[other_section_name]}
```