Solved

how to program a delay in a bash-script

Posted on 2000-05-10
4
5,364 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Steps to follow for Maintenance of Servers 4 63
How to install Ubuntu 16 in DELL venue 8 pro 20 153
error log using ftp 7 41
bash file 10 37
Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
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…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

778 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