Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
11-28-2005, 07:41 AM
|
#1
|
Member
Registered: Feb 2005
Posts: 106
Rep:
|
want to use shell script auto update IP~!and do a forward
sorry about my english.
in my situation.
i am using ddns client programe to change my domain's ip
now,i want to write a shell script to do it
i jsut want to let shell script know
if my current ip isn't same as before 10 minute's ip then run ddns programe to update the newest ip.
how to write it? and how to run the *.sh ervery second?
other problem,
every time run crond successed,then system auto e mail to root@localhost
also ,i want to write script to mail to /dev/null
thanks in advance
Last edited by singying304; 11-28-2005 at 07:45 AM.
|
|
|
11-28-2005, 08:22 AM
|
#2
|
Senior Member
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783
Rep:
|
for the first one, you can use the sleep command to make your script to sleep and wake up after n seconds. If you do this through an infinite loop, you can make your script run every n second.
|
|
|
11-28-2005, 08:37 AM
|
#3
|
Member
Registered: Feb 2005
Posts: 106
Original Poster
Rep:
|
Quote:
Originally posted by perfect_circle
for the first one, you can use the sleep command to make your script to sleep and wake up after n seconds. If you do this through an infinite loop, you can make your script run every n second.
|
i just know little programe logic,but i don't know how to do it...
|
|
|
11-28-2005, 08:46 AM
|
#4
|
Senior Member
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783
Rep:
|
Code:
#!/bin/sh
while [ 0 ]; do
echo "Hello world"
sleep 2
done
if you save this script in a file and give execute permission to the file, when you run it, it will print hello world every 2 seconds.
|
|
|
11-29-2005, 05:32 PM
|
#5
|
Member
Registered: Feb 2005
Posts: 106
Original Poster
Rep:
|
Quote:
Originally posted by perfect_circle
Code:
#!/bin/sh
while [ 0 ]; do
echo "Hello world"
sleep 2
done
if you save this script in a file and give execute permission to the file, when you run it, it will print hello world every 2 seconds.
|
thanks~
then who can offer me the full script?
|
|
|
All times are GMT -5. The time now is 05:07 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|