Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-25-2007, 11:04 AM   #1
Registered: Oct 2006
Location: New York
Distribution: Debian
Posts: 675
Blog Entries: 11

Rep: Reputation: 36
shell script question

How do you make a shell script in bash pause for a number of seconds? Thanks in advance. I want to wait for something to happen and then start something else that relies on the first thing. -Dave
Old 03-25-2007, 11:34 AM   #2
LQ Guru
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 62
You could use the sleep command. I have as used ping command to pause as well.
ping -c10 > /dev/null

Old 03-25-2007, 11:43 AM   #3
Senior Member
Registered: May 2006
Distribution: Caldera, CTOS, Debian, FreeBSD, Mac OS X, Mandrake, OpenBSD, Slackware, Solaris, SuSE, Xubuntu
Posts: 1,757

Rep: Reputation: 80
A while loop might be what you want:

Or until loop:
Old 03-25-2007, 12:38 PM   #4
Registered: Oct 2006
Location: New York
Distribution: Debian
Posts: 675
Blog Entries: 11

Original Poster
Rep: Reputation: 36
'sleep' is what I probably want. I was 'man'-ing 'wait'. NOT the same. Thanks!!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
shell script Question Whiteghost Programming 4 09-25-2005 10:05 PM
shell script question Whiteghost Programming 17 09-10-2005 06:52 PM
shell script question rrwhite Linux - General 3 09-15-2004 01:01 AM
Shell script question. siaful Linux - Newbie 1 04-29-2004 05:01 PM
Help me!!!!!shell script question!!!!!! yulitao Programming 2 03-23-2004 03:40 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:31 AM.

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