So i am trying to have the output of my ssh command consumed at different points in time and potentially within a subshell as well. I tried with fifos and with exec like:
exec 10< <(ssh host 'i=0;while :;do ((i++));echo $i;done') read a <&10 echo $a read a <&10 echo $a
the output i am looking is: 1 and 2. currently i get 1 and 1, a new process starts every time i read from the fd 10. Same thing with fifo. Any ideas of how to sort this out?
EDIT: I restarted my pc and the problem disappeared. It might had been yet another issue with wsl2