Making mplayer skip some files.
GNU/Linux kernel 2.6, Slackware 12.0
MPlayer 1.0rc2-4.1.2
GNU Bash 3.1.17
Hi:
I've got a set of MP3 files on dir .../foo/ and I want mplayer to play them sequencely but skipping some of them. If I run 'mplayer *' this will do but ofcourse won't skip any files. I think a shell script could be written to do that. It would be something like this (using some pseudocode):
#!/bin/bash
#After an example from Intro_Linux by M. Garret.
LIST=$(ls *.mp3)
j=0
for i in $LIST; do
ORIG=$i
if j not in {2,7,8} # this I don't know how to do it.
then mplayer ORIG
fi
j=j+1
done
Kind regards.
Last edited by stf92; 06-07-2010 at 07:24 AM.
|