Solved

how to program a delay in a bash-script

Posted on 2000-05-10
4
5,371 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
ID: 2797078
sleep 3
0
 
LVL 2

Expert Comment

by:modulus
ID: 2797108
#!/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
ID: 2797109
Guess ozo got there first!

m.
0
 

Author Comment

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

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SUSE Linux Enterprise 11.x Ensure tftp server is not enabled 1 45
The better OS Architecture 13 68
Internal CA server 6 50
Unix Help with:  mailx -s 17 21
The purpose of this article is to demonstrate how we can use conditional statements using Python.
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

830 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