Skip to content

Instantly share code, notes, and snippets.

View yaroslavzghoba's full-sized avatar
🕊️

Yaroslav Zghoba yaroslavzghoba

🕊️
View GitHub Profile
@kwmiebach
kwmiebach / get_toml_value.sh
Last active September 13, 2025 17:26
Read values from a simple toml file in bash
#######################################################################################
# Bash function get_toml_value() to get the value of a key in a section of a TOML file.
# Versioned here: https://gist.github.com/kwmiebach/e42dc4a43d5a2a0f2c3fdc41620747ab
# Call it like this:
# value=$(get_toml_value "./conf/config.toml" "server_b" "domain")
# Result should be "my123.example.com" in the case of this example file:
# ---------------------------
# [server_a]
# proto = "https"
# domain = "test.example.net"