PC & IT SUPPORT MADE EASY FORUM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Talking Countdown With Bash On Linux

Go down

Talking Countdown With Bash On Linux Empty Talking Countdown With Bash On Linux

Post by jamied_uk 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
jamied_uk
jamied_uk
Admin

Posts : 2952
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Talking Countdown With Bash On Linux Empty Re: Talking Countdown With Bash On Linux

Post by jamied_uk 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
jamied_uk
jamied_uk
Admin

Posts : 2952
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Back to top

- Similar topics

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