On my Linux machine, I am trying to shuffle all music in my directory and play it. When I run omxplayer $(ls -1b |sort -R)
, it says /usr/bin/omxplayer.bin: invalid option -- '\'
. This doesn't make sense. omxplayer
should run the output of ls -1b
which should show the output of the directory in 1
column and show escape characters so it would recognize the spaces. What am I doing wrong and how else could I shuffle all music in my directory and play it?
omxplayer "$(ls | shuf -n 1)"
should work.
-
"might work"? what are the failure cases? (see mywiki.wooledge.org/ParsingLs) – Jeff Schaller♦ Mar 25 '17 at 16:36
man omxplayer | grep -i shuffle
oromxplayer --help
– Mio Rin Mar 25 '17 at 18:31