i want to play some music files with mplayer
randomly. I don't want to switch the player for that, i want to understand what's wrong here.
ThePandaTooth $ ls
file_1.ogg
file_2.ogg
file_3.ogg
I know, the output of ls | sort -R
results in a randomized output of filenames. But I can't play them, with the odd reason, it can't find the file. The sorting is irrelevant here.
ThePandaTooth $ mplayer $(ls | sort -R)
Playing file_1.ogg.
Cannot open file 'file_1.ogg': No such file or directory
Failed to open file_1.ogg
Playing file_2.ogg.
Cannot open file 'file_2.ogg': No such file or directory
Failed to open file_2.ogg
EDIT: Mplaying the files with mplayer *
works of course.
ls -l
. – Michael Homer Jan 2 '16 at 20:39mplayer $(\ls | sort -R)
I bet you have an aliasls --color=always
. – jimmij Jan 2 '16 at 20:48ls
with full path:mplayer $(/bin/ls | sort -R)
– Dan Cornilescu Jan 2 '16 at 21:01