How about this: #!/bin/bash count=0 IFS=' ' while true do for f in $(ls ${FILES} | sort -R) do printf "%3d> %s\n" "$count" "$f" count=$((count+1)) done done Because I'd like it to loop endlessly, but also create a new random playlist each iteration in the while loop. Thanks again :)
That's not what the problem is... :cry: I can loop through the file names fine. The problem is omxplayer doesn't like it... from it's output I can I am sending the correct file path, but I get a segmentation fault. In the first loop I showed it plays fine. Again, why does it work in the first loop b...
I have a bunch of videos here: /media/blah/ I'm trying to loop through them randomly in bash. Right now I have it choosing a random video each time one finishes: while true do files=(/media/blah/*.mkv) omxplayer -o hdmi "${files[RANDOM % ${#files[@]}]}" done And that works.. but What I'd rather have...