EMAIL_ADDRESSES=( e.litherlandsmith@proton.me e.litherlandsmith@icloud.com evie.litherland-smith@ukaea.uk ) LABELS=("Proton" "iCloud" "Outlook") for i in "${!EMAIL_ADDRESSES[@]}"; do ADDRESS="${EMAIL_ADDRESSES[$i]}" LABEL="${LABELS[$i]}" secret-tool lookup email "$ADDRESS" >/dev/null || ( echo "Setup $LABEL" secret-tool store --label="$LABEL mail mbsync" email "$ADDRESS" ) done