[MPlayer-users] BUG: stream_file.c: reconnects to fifos

Dominique Michel dominique.michel at vtxnet.ch
Sat Aug 25 00:14:18 CEST 2012


Le Thu, 23 Aug 2012 16:55:28 +0100,
Tom Evans <tevans.uk at googlemail.com> a écrit :

> On Wed, Aug 22, 2012 at 9:45 PM, PyroPeter <tristan at pyropeter.eu>
> wrote:
> > On 08/22/2012 10:17 PM, Ron Johnson wrote:
> >> Would an alternative be:
> >> for f in $(find /stuff); do mplayer "$f"; done
> >
> > No, because it is really hard to get bash to loop over a list of
> > files with spaces in the filenames.
> 
> I don't want to get too OT with advanced bash scripting, but
> find-while-read loop is the bash solution for this.
> 
> find .. | while read fn ; do mplayer "$fn" ; done

This will bail at least with quoting characters into the file names.
Yes, crazy peoples are even using quoting characters in their file
names... And no one but a system crash will stop them :)

For loops combined with IFS change will work much better:

old_IFS=$IFS
IFS=$'\n'
for i in $(ls -A)
do
    mplayer "$i"
done
IFS=$old_IFS

Ciao,
Dominique

-- 
"We have the heroes we deserve."


More information about the MPlayer-users mailing list