On 2017-05-15 04:03, Carl Hartung wrote:
On Mon, 15 May 2017 02:57:20 +0200 Carlos E. R. wrote:
The important thing to know is that in a bash script, $! contains the PID of the previous backgrounded program. $? should contain the PID of the previous command, and $$ the one of the shell or script.
With that info it is easy to write a script with wget instead :-)
Thanks for crossing my T's and dotting my I's Carlos! :)
Ah, you gave me the needed clue for finding the rest of the info. :-) Previous to your post I had no idea how to do it. When I saw that I remembered that I wrote a note about it!
Istvan didn't describe the stream in detail, but as I presently understand it, when wget is used to retrieve a typical stream 'link,' it usually yields just a meta file which specifies the mime type and/or protocol along with the proper stream URI. I know it can be used to fetch media files, but I'd be very surprised to learn that it can now also decode and dump streams :) hence my quick example showing one of many possible alternate solutions.
Yep! :-) I'm now thinking of tools like "youtube-dl" that will download a youtube (or some other sources) video or audio and store it correctly. The tool parses the page to find out the link that would have to be given to wget to download it. Another tool for downloading streams is "streamripper", specially for radio stations on internet. This one has CLI options for automatically stopping after so many seconds. -- Cheers / Saludos, Carlos E. R. (from 42.2 x86_64 "Malachite" (Minas Tirith))