Created
December 7, 2017 14:05
-
-
Save marcinhlybin/b43551baa8da2cd854c58dd707ae4339 to your computer and use it in GitHub Desktop.
Contemporary Bash Art
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while read line; do | |
if [[ $line =~ ^"["(.+)"]"$ ]]; then | |
arrname=${BASH_REMATCH[1]} | |
declare -A $arrname | |
elif [[ $line =~ ^([_[:alpha:]][_[:alnum:]]*)"="(.*) ]]; then | |
declare ${arrname}[${BASH_REMATCH[1]}]="${BASH_REMATCH[2]}" | |
fi | |
done < /etc/pushover.conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The same in Python: