Skip to content

Instantly share code, notes, and snippets.

@froi
Created September 6, 2024 18:23
Show Gist options
  • Save froi/43b3c4f3646c2b21ba809d402ad3d4e9 to your computer and use it in GitHub Desktop.
Save froi/43b3c4f3646c2b21ba809d402ad3d4e9 to your computer and use it in GitHub Desktop.
Declaring and using hashmaps in Bash
#!/usr/bin/env bash
declare -A profile_urls=(
[github]=https://github.com/froi
[blog]=https://froi.dev
[mastodon]=https://mastodon.social/@froi
[linked_in]=https://linkedin.com/in/froilanirizarry
)
for key in "${!profile_urls}[@]"; do
echo "${profile_urls[$key]}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment