#!/bin/bash if [ $# -lt 1 ]; then echo "enter a song name, format: wav, ex: happy.wav" exit else echo "song name:$1" fi while true do cmd=$( ps -ef | grep -v grep | grep -v $0 | grep $1 | awk '{print $2}') if [ "${cmd}" != "" ]; then sleep 1 else aplay $1 & fi done
沒有留言:
張貼留言