Skip to content

Instantly share code, notes, and snippets.

@forthxu
Created January 7, 2015 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save forthxu/c72f3c614e8d2be62676 to your computer and use it in GitHub Desktop.
Save forthxu/c72f3c614e8d2be62676 to your computer and use it in GitHub Desktop.
晚安版
#!/bin/bash
musics_dir='/workspace/work/other/mp3/';
j=0;
musics=();
for file in $(ls ${musics_dir});do
musics[$j]=$file;
let "j+=1";
done
musics_length=${#musics[@]};
for ((i=0; i<3; i++));do
x=`expr $RANDOM % $musics_length`;
#echo $x;
mplayer ${musics_dir}${musics[$x]};
sleep 5s;
espeak -vzh "主人,该去睡叫勒,不然起不来";
sleep 1m;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment