f(){ local c read -n1 c&&f >$c&&r[x$c++]=\>$c$r||r=${r/>/v} } f echo ${r/>}