Created
November 16, 2016 04:26
-
-
Save hsali/03c2d3377733bcf691d3329a2e81297e to your computer and use it in GitHub Desktop.
Random play Music with mplayer in a specific folder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$1" = "" ]; then | |
echo "no directory defined!" | |
exit | |
fi | |
if [ "$2" = "" ]; then | |
echo "no file extension defined!" | |
exit | |
fi | |
while [ 1 ] | |
do | |
FILE=$(cd ${1}; find * | grep ${2}$ | shuf -n 1) | |
path1="$1$FILE" | |
/usr/bin/mplayer "$path1" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example to play music.
Go to the folder where your audio file placed.
Syntax:
###Example