Skip to content

Instantly share code, notes, and snippets.

@forthxu
Created Jan 7, 2015
Embed
What would you like to do?
晚安版
#!/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