Skip to content

Instantly share code, notes, and snippets.

@aczietlow
Last active October 25, 2023 19:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aczietlow/1f89803805c5b3b0a6aab7ca96e96342 to your computer and use it in GitHub Desktop.
Save aczietlow/1f89803805c5b3b0a6aab7ca96e96342 to your computer and use it in GitHub Desktop.
Bashing my head in
#! /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