Talking Countdown With Bash On Linux

View previous topic View next topic Go down

Talking Countdown With Bash On Linux

Post by jamied_uk on 23rd May 2016, 20:39

Code:

#!/bin/bash
COUNT=$1
#
# Usage ./countdown_5_Extra.sh 5
#
#
while [ $COUNT -gt 0 ]; do
        echo $COUNT | espeak
    let COUNT=COUNT-1
done
echo GO!

You will need espeak installed

Code Update Link
https://app.box.com/s/c4pwupnllsdf3ymrqdijc36k1if3rr9y


Code:
sudo apt-get install -y espeak






forum.linuxcareer.com/threads/1655-Bash-reverse-counting-with-while-loop


Last edited by jamied_uk on 23rd May 2016, 21:23; edited 1 time in total
avatar
jamied_uk
Admin

Posts : 2260
Join date : 2010-05-09
Age : 34
Location : UK

http://address-shortner.co.uk

Back to top Go down

Re: Talking Countdown With Bash On Linux

Post by jamied_uk on 23rd May 2016, 21:22

Code:
#!/bin/bash
COUNT=$1
#
# ./countdown_5_Extra.sh 5
#
# Start
msg="Self Destruct, In "
msgtwo="Self Destruct, Sequence Canceled! It Is NOT youre time yet! HA Ha"
echo $msg | espeak
#
while [ $COUNT -gt 0 ]; do
        echo $COUNT
    echo $COUNT | espeak
    let COUNT=COUNT-1
done
echo GO!
#
echo $msgtwo | espeak
avatar
jamied_uk
Admin

Posts : 2260
Join date : 2010-05-09
Age : 34
Location : UK

http://address-shortner.co.uk

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum