#!/bin/zsh read -s 'p?Password:'$'\n' typeset -a oath echo OATH URIs: while read -r x; do [[ -z $x ]] && break oath+=($x) done for x in $(ykman list --serials); do ykman -d $x oath accounts list -Hp $p | while read -r y; do ykman -d $x oath accounts delete -fp $p ${y/%$'\r'} done for y in "$oath[@]"; do ykman -d $x oath accounts uri -fp $p $y done done