>while read< loop terminates/quits after a single cycle
Hello Everybody,
I tried to find an answer to whatever is happening with my sh, tried a few approaches, but none is working the way I planned... the loop quits with exit 0, runs once, if I comment out `ffmpeg` line, it runs N times as it should - ffmpeg does not error out other than 0 Code:
find . | grep \.mp3 | while read filename I also tried to feed the loop with: done < /tmp/fname.list Thanks! edit: BTW, this works well - but I am very interested in the >while read< loop giving up. Code:
for i in *.mp3; do ffmpeg -i "$i" -acodec libvorbis -ac 2 -aq 4 -y "$(basename "$i" .mp3).ogg"; done |
I don't know about your main problem, but I see a lot of things in your script which could be done better.
Quote:
Code:
find . -name '*.mp3' | while read filename Quote:
Code:
newfilename="${filename%.mp3}" |
|
Thank you MTK358 & Guttorm,
MTK358 - I completely agree, \.mp3 is not an ultimate, nor even a good approach, probably at the end of the list of possible approaches. Thank you! Guttorm - the link you provided is the answer to a the loop quitting with ffmpeg - adding '< /dev/null' fixed its behavior: Quote:
Thank you and have a GOOD day and/or night! paziu |
All times are GMT -5. The time now is 04:09 AM. |