newbie: trying to use pipe or awk to work with mplayer
Hi,
I have a text file containing the URL I wanted for mplayer to play. Currently, I play those in commend line using the following steps: 1)cat playlist 2)use mouse to highlight the link 3)type: mplayer then click both left/right mouse button I was hoping if I can do this in comment line without mouse. I've tried the following without luck (assume there's only 1 address in the text file) 1) cat playlist |mplayer 2) cat playlist |awk '{print $1}'| mplayer Thank you. |
Hard to say w/o knowing the structure of the playlist ....
something like cat playlist | xargs -i mplayer {} may work |
Hi Tinkster,
cat playlist | xargs -i mplayer {} works like champs! One thing I noticed, however, mplayer appeared to play in the background hence I was unable to end the stream with the "q" key (had to use ctrl-C then you will see mplayer's PID stuck in ps and can't be kill). Have you experienced that issue? As for the structure of the playlist, consider the following example: Code:
tux@esceo:~$ cat playlist |
Can't say I've used mplayer to play urls at all, I'm afraid, so
wouldn't know how it handles this. Does mplayer terminate when you invoke that individually from the command-line? E.g., mplayer http://scfire-dtc-aa01.stream.aol.com/stream/1005 |
Yea, in commend line, if you do mplayer <whatever>, you should be able to terminate the program by hitting the "q" key.
Seems like this is mplayer issue more then command line issue, I guess I will figure that out somewhere else :) Thank you very much, Tinkster. |
All times are GMT -5. The time now is 02:54 AM. |