标签:view rap size finish load res http down statistic
#!/bin/sh
# very simple example shell script for mp3 player
# 2014-5-6 by slwang
#实现搜索全部mp3文件并顺序播放歌曲
path1=~/Music
path2=~/Downloads
temp_file=/tmp/temp_files$$
musicset=""
menu_choice=""
isnext="n"
trap ‘rm -f $temp_file && audacious -s‘ EXIT
set_menu_choice() {
clear
echo "mp3 player menu :-"
echo " p) play"
echo " u) pause"
echo " s) stop"
echo " n) next"
echo " c) count"
echo " l) list"
echo " q) quit"
echo "please input: \c"
read menu_choice
}
clear
echo "welcome to mp3 player"
sleep 1
IFS="
"
find $path1 $path2 -name *.mp3 -print > $temp_file
musicset=$(cat $temp_file)
#more $musicset > $temp_file
for music in $musicset
do
echo "Beign to play $music"
audacious -h $music
isnext="n"
while [ "$isnext" = "n" ]
do
set_menu_choice
case $menu_choice in
p) audacious -p
;;
u) audacious -u
;;
s) audacious -s
;;
n) isnext="y"
;;
c) IFS=" "
set $(wc -l $temp_file)
lines=$1
echo "total include $lines songs"
echo "press return"
IFS="
"
read x
;;
l) more $temp_file
echo "press return"
read x
;;
q) exit 0
;;
esac
done
done
IFS=" "
rm -f $temp_file
audacious -s
echo "finished"
exit 0
(转载请注明作者和出处:http://blog.csdn.net/awakewind 未经同意请勿用于商业用途)
(想与博主一起在技术上成长,请移步
knowthendo.cn)
标签:view rap size finish load res http down statistic
原文地址:https://www.cnblogs.com/xfgnongmin/p/10856047.html