Last active
December 19, 2015 00:39
-
-
Save helllth/5870344 to your computer and use it in GitHub Desktop.
Beeper ... makes some noise
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
COUNTER=0 | |
speech="th Beep" | |
speech2=" of " | |
pause=$2 | |
if [ ! -z $1 ] && [ $1 = ? ] | |
then | |
echo "beep [nummer of beeps] [pause in seconds]" | |
exit | |
fi | |
if [ -z $1 ] || [ $1 = 1 ] | |
then | |
say Beep | |
else | |
if [ -z $2 ] | |
then | |
pause=0 | |
fi | |
while [ $COUNTER -lt $1 ]; do | |
let number=COUNTER+1 | |
TEXTS=$number$speech$speech2$1 | |
say $TEXTS | |
let COUNTER=COUNTER+1 | |
if [ $number -lt $1 ] | |
then | |
sleep $pause | |
fi | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage is
beep [nummer of beeps] [pause in seconds]