![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Ping command | aladdin | UNIX for Dummies Questions & Answers | 3 | 12-05-2006 12:54 PM |
| UNable to find ping command | swepaul | UNIX for Dummies Questions & Answers | 3 | 05-29-2005 11:17 PM |
| -c option in ping command | Deepa | Shell Programming and Scripting | 3 | 05-31-2002 03:05 AM |
| how to use PING command efficiently | hoang | IP Networking | 1 | 04-16-2002 02:04 AM |
| About ping command | Papa Deoo | IP Networking | 2 | 09-20-2001 09:50 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Hi!
I have small problem. I want to ping a server and the result shouldn't be printed in the browser window, just become a value. Here you can see the script that I have: <? $command="ping linux.com -t ttl -c1 | tail -1 | awk '{print $4 \" \" $5}'"; $output = system($command); system("exit(0)"); echo "DATA: $output"; ?> When I run this in my browser the resualt will be as follow: 33.1/33.1/33.1 ms DATA: 33.1/33.1/33.1 ms The echo value is just a test for me to see if the $output value is OK. What I want is that the value before DATA: 33.1/33.1/33.1 ms shouldn't be viewed in the browser just DATA: 33.1/33.1/33.1 ms Could someone please help me with this problem? Best Regards Peter Håkansson |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Re: About ping command
Quote:
Anyway, change your script (looks like PHP?) to: Code:
<?
$command="ping linux.com -t ttl -c1 | tail -1 | awk '{print \"DATA: \" $4 \" \" $5}'";
system($command);
?>
HTH removed html tags / added code tags --oombera Last edited by oombera; 02-16-2004 at 07:17 AM. |
||||
| Google The UNIX and Linux Forums |