Bash while loop wait until task has completed
问题 I have a bash script that I created to process videos from within a folder and it's subfolders: find . -type f -name '*.mkv' | while read file; do ffmpeg -i $file ... done The problem: Instead of the while loop waiting ffmpeg to complete, it continues iterate through the loop. The end result is, files not getting processed. I need a way to have the current while loop iteration to wait until ffmpeg is complete before continuing to the next. Or alternatively a way to queue these items. Edit: So