Last active
October 25, 2023 19:49
-
-
Save aczietlow/1f89803805c5b3b0a6aab7ca96e96342 to your computer and use it in GitHub Desktop.
Bashing my head in
This file contains hidden or 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
#! /bin/bash | |
# pipe input from column | |
# | |
# Usage | |
# | |
# ex. cat output.txt | column -t | ./profileMappingMapping.sh | |
# | |
# for funzies you can pipe out to column again | |
# | |
# cat output.txt | column -t | ./profileMappingMapping.sh | column -t | |
declare -A profileMappings | |
cypher="AES256-xxx:xxx-xxx" | |
while read -r key value; do | |
profileMappings["$key"]="$value" | |
done | |
# Print associative array for debugging | |
for k in "${!profileMappings[@]}"; do | |
if [[ -z "${profileMappings[$k]}" ]]; then | |
profileMappings[$k]="$cypher" | |
fi | |
printf "%-15s %s\n" "$k" "${profileMappings[$k]}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment