LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-25-2007, 07:09 AM   #1
kutlu
LQ Newbie
 
Registered: Dec 2007
Posts: 27

Rep: Reputation: 15
command line counter tool to replace "sleep"


I am looking for a command line tool which will replace sleep command, I want it to show the countdown in command line. I am curious about how much time is left.
 
Old 12-25-2007, 09:48 AM   #2
Slick666
Member
 
Registered: Feb 2006
Distribution: Ubuntu 8.04; Debian Etch
Posts: 167

Rep: Reputation: 33
Why don't you write a shell script to do the job
Code:
for[[i=100; i>0; i--]]
do
    echo $i
    sleep 1
done
Something like that would do what you wanted and you could customize it to have the exact output you want.
 
Old 12-25-2007, 03:27 PM   #3
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
#!/bin/bash

for ((i=100;i>0;i--));
do
echo $i
sleep 1
done
 
Old 12-25-2007, 10:42 PM   #4
kutlu
LQ Newbie
 
Registered: Dec 2007
Posts: 27

Original Poster
Rep: Reputation: 15
Thanks, I'll do it.
 
  


Reply

Tags
sleep



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
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 10:18 PM
How to write a bash script to replace all "KH" to "K" in file ABC??? cqmyg5 Slackware 4 07-24-2007 09:00 AM
Why does "crond" sleep and "ssh" hung up? Chowroc Linux - Networking 0 01-12-2006 12:24 AM
cdrecord command-line parentheses "(" ")" coolingtower Linux - Software 1 10-28-2005 11:49 AM
"host" command/tool. Where to get it? tommmmmm Slackware 3 09-10-2005 12:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:40 PM.

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