Re: Re[2]: [PHP] Using system
| From: | Jason Wong | Date: | Wed, 17 Sep 2003 15:17:14 +0000 |
| Subject: | Re: Re[2]: [PHP] Using system | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-162890@lists.php.net to get a copy of this message | ||
On Wednesday 17 September 2003 22:49, Uros wrote:
> I think not
Believe it or not, Robert's answer is correct.
> here is my code
>
> #!/usr/local/bin/php -q
> <?php
> $ret = `nslookup -timeout=3 www.myhost.com |grep "Non-existent
> host/domain"`; ?>
> I always get automaticaly output. I also try to set implicit_flush to off,
> use ob ob_...
*What* exactly is the output that you're getting?
Newer versions of nslookup on Redhat Linux (and Mandrake, and maybe others as
well) will give an *error* recommending that you use dig instead. To prevent
that particular warning from displaying you need the "-sil" option. To
redirect all errors elsewhere you can do something like:
nslookup -timeout=3 www.example.com 2>/dev/null | grep "Non-existent
host/domain"
And on my version of nslookup a non-existent domain gives this error message:
** server can't find www.example.com: NXDOMAIN
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Robert Tappen Morris, Jr., got six months in jail for crashing 10% of the
computers that Bill Gates made $100 million crashing last weekend.
*/