I used function system() to copy several files, and to deal with possible interaction, I also used the command 'yes'. The code I used is like
system('yes | cp -f filename destination')
The command works well in the terminal, but doesn't work when I run the above in matlab, which cannot return to the matlab process.
However, if I remove 'yes', the following works
system('cp -f filename destination')
Could someone please tell me what I should do to fix the first one and what the problem is? Thank you!
I use Matlab R2019a on macOS Catalina.
Best Answer