Music Script

We use the following scipt to play audio files in one folder (randomly ordered) from the command line.

Note: The Bash script uses mplayer.

Script:

#!/bin/bash

folder=${1:-"."}
extension=${2:-"mp3"}
search_string=${3:-""}
cur_folder=${pwd}

cd "${folder}"
mplayer -shuffle *${search_string}*.${extension}
cd "${cur_folder}"

Usage, where

./backup.sh folder extension search_string