Bash script Question while loop
Hi all
This is probably an easy question, but for some reason I can't figure out why my loop ends doing only one task. Code:
#!/bin/bash I'm using bashpodder to get my podcast, which creates a simple playlist named podcast.m3u. Then I need to convert the files into something my sony mp3 player can read(mainly 44100 sample rate). I'm going to run the above to do that, but it ends after 1 line of the .m3u file. Any help would be appreciated Thanks John |
You seem to be throwing away all messages from ffmpeg. Try it without the &>/dev/null to see if you might be getting an error return that's aborting your loop.
It's always a "good thing" to check after running a command to see if it has returned an error code. <aside> What's the point of defining datadir if you hard-code 48k in your output specification? </aside> |
Thanks for responding,
I tried to do it with out &>/dev/null prior to adding it same result(i thought before the output was the problem so I added &>/dev/null). I guess I could take datadir(!!oops i get it i corrected the code) out but I wasn't sure it would create it just by my hardcode. |
Well I solved my problem by going this route.
Code:
for podcast in `cat podcast.m3u` Thanks John |
The problem here is that ffmpeg is reading the standard input. This shold solve the problem:
Code:
while read podcast |
Thanks gorbeia, I haven't tried it yet but it makes sense to me that it will work.
|
Hello I run pcLos and I want to run a bash script to download my poddcasts regardless of what ever user is logged in. I am most likely to use Kpodder but who knows? Would I use cron? How do I do it?
|
All times are GMT -5. The time now is 08:09 AM. |