LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-23-2003, 05:55 AM   #1
AMMullan
Member
 
Registered: Sep 2003
Location: United Kingdom
Distribution: Ubuntu, Arch
Posts: 438

Rep: Reputation: 30
Counter


I am trying to make a little shell script and wanna have a little couter in it, so the user might input their name and then the script will countdown and do something.

What's the best way of doing this?
 
Old 10-23-2003, 05:56 AM   #2
AMMullan
Member
 
Registered: Sep 2003
Location: United Kingdom
Distribution: Ubuntu, Arch
Posts: 438

Original Poster
Rep: Reputation: 30
Oh, when I say counter I mean 5... 4... 3... not the sleep command
 
Old 10-23-2003, 12:54 PM   #3
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Code:
#!/bin/sh

echo Start
count=5
while [ $count -gt 0 ] ; do
    echo -n "${count}.."
    count=$((count - 1))
    sleep 1
done
echo
echo Poof!
 
Old 10-23-2003, 01:41 PM   #4
AMMullan
Member
 
Registered: Sep 2003
Location: United Kingdom
Distribution: Ubuntu, Arch
Posts: 438

Original Poster
Rep: Reputation: 30
Hehe thats kewl

Is there any way of actually getting rid of the old number?
 
Old 10-23-2003, 02:09 PM   #5
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Code:
#!/bin/sh

echo Start
count=5
while [ $count -gt 0 ] ; do
    echo -n -e "\a\b$count"
    count=$((count - 1))
    sleep 1
done
echo
echo -e "Whoop!"

Last edited by Hko; 10-23-2003 at 02:14 PM.
 
Old 10-23-2003, 02:11 PM   #6
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
How to rid of the cursor?
I don't know.
You'll need something like the "dialog" utililty.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
hit counter dragon Programming 6 07-04-2005 10:06 PM
Counter-strike,[color=orange]H ë L F - L I F E ²[/color],Counter-strike: Source. Dennisgoop Linux - Games 2 08-10-2004 03:03 AM
Counter-strike help please effect Linux - Games 2 07-02-2004 05:16 PM
Web counter jimval7 Programming 2 10-20-2003 05:15 PM
looking for a web counter fly.fisher Programming 3 07-16-2001 05:44 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration