Solved

how to program a delay in a bash-script

Posted on 2000-05-10
4
5,356 Views
Last Modified: 2009-06-08
i've got a little script to connect my pc to the internet. due to I'm using ip-masquerading, I have to run a script for the ipchains-rules. my problem: when I run this script which sets the rules for ipchains just after I gave the command to connect to my isp, I have no IP-adress. so i have to run this script for a second time, after about 3 seconds (I'm using ISDN). now I wanna ask, if there is a bash "delay"-command. It have not to be exactly. about 3 or 5 seconds on a pentium 100.
0
Comment
Question by:zulliger
  • 2
4 Comments
 
LVL 84

Accepted Solution

by:
ozo earned 100 total points
Comment Utility
sleep 3
0
 
LVL 2

Expert Comment

by:modulus
Comment Utility
#!/bin/bash
echo "Now";
command sleep 10;
echo "Then";

Can do seconds, minutes, hours.  Default units are seconds.

Best wishes,
modulus
0
 
LVL 2

Expert Comment

by:modulus
Comment Utility
Guess ozo got there first!

m.
0
 

Author Comment

by:zulliger
Comment Utility
thank you very much! (I hope it will work, because I havent't tried it yet...)
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In this tutorial I will explain how to make squid prevent malwares in five easy steps: Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response times by caching and reusing frequently-…
How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now