ProgrammingThis 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.
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.
this works fine with bash-2.05b-12mdk, but craps out with bash-2.05-16mdk. Is this a known issue? has anyone else encountered the same? Any thoughts or tips would be appreciated.
Sorry, forgot to mention that the part it seems to have problems with is the -c 1. This is where I get the error when running from my script.
It works fine from the command line but not when called from the scipt.
The command runs from the command line in that shell, on that computer, but not from the script. both are using the same kernel (2.4.21), one is mandrake 9.1(it works on this one) the other is mandrake 8.2 (doesnt work on this one).
The error:
./set_time : 1: command not found
The script:
#ping to see if connection to server exists. Looks for 100% packet loss.
result= `ping -c 1 172.16.0.6 | grep -e 100\%`
#if result is blank ping was good (there is a connection to the server)
if [ test $result != '' ]
then
#syncs time with relication server in yellowknife and then syncs the system and hardware clocks
/usr/bin/rdate -s replication.arcticco-op.com
/sbin/clock -w
echo `date` time sync successful. >> set_time.log
else
#if there is no connection to the server, this appends a line to the log with time and date.
echo `date` time sync was unsuccessful, no connection to server >> set_time.log
exit;
fi
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.