1 2 3 4 5 6 7 8
#!/usr/bin/env bash for arg in "$@"; do keydomain="${arg%%)*}" keypath="${arg#*)}" domain="$(IFS=,; printf '%s\n' $keydomain|tac|xargs|tr ' ' '.')" echo "$domain$keypath" done