Alias in .bashrc, selecting random file

Alias in .bashrc, selecting random file:

Hi Linux4Noobs,

I am engaged in an endeavor to alias a command to have mplayer play a random nature documentary from a directory, let’s call it $PRONDIR.

The following code snippet in my .bashrc works:

 alias mpron="mplayer $(find $PRONDIR -type f | shuf -n 1 |sed 's/ /\\ /g' )" 

except that it retains memory of the first file generated in that particular shell, so one would have to close and reopen the shell if one got tired of the nature documentary and wished to view an alternate random nature documentary.

Do any other nature enthusiasts have some advice so I don’t have to keep closing my shell?

submitted by /u/ancientkangz
[link] [comments] via Linux 101 stuff. Questions are encouraged, noobs are welcome!