![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Ping Problem | ashokmeti | IP Networking | 4 | 02-07-2008 09:42 AM |
| help help cronjob problem with script | bucci | Shell Programming and Scripting | 4 | 02-10-2007 04:38 AM |
| ping problem | vviscomi | UNIX for Dummies Questions & Answers | 1 | 12-22-2004 03:49 PM |
| Problem with cronjob... | kswaraj | Shell Programming and Scripting | 1 | 07-14-2004 03:58 PM |
| Ping problem. system down!! | TRUEST | Shell Programming and Scripting | 3 | 02-21-2003 03:16 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
ping cronjob problem
Hi all,
I'm trying to write a shell script that will ping a site and and write the date and 1 or 0 (for success or no success) to a file. it looks roughly like this: #/bin/sh set mydate = `date` set myvar = `ping -c 1 hostname | grep -c "100%"` if ($myvar == 1) then echo $mydate" 0" >> banneruptime.txt else echo $mydate" 1" >> banneruptime.txt endif It works when I call it from the commandline, but not when i call it from a cronjob. On my MacOS X machine ping resides in /sbin, so I added that to the cronpath. But I get a "syntax error: unexpected end of file" error. Any ideas? Thanks. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|