Skip to content

Instantly share code, notes, and snippets.

@helllth
Last active December 19, 2015 00:39
Show Gist options
  • Save helllth/5870344 to your computer and use it in GitHub Desktop.
Save helllth/5870344 to your computer and use it in GitHub Desktop.
Beeper ... makes some noise
#!/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
@helllth
Copy link
Author

helllth commented Jun 26, 2013

Usage is beep [nummer of beeps] [pause in seconds]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment