Ping puzzle
David Kramer
david at thekramers.net
Wed Mar 26 15:32:25 EST 2003
On Wednesday 26 March 2003 02:44 pm, John Chambers wrote:
> Here's a bizarre puzzle that I've been trying to solve on several
> linux boxen: How does a parent process read the stderr of /bin/ping?
>
> It oughta be trivial. But consider this ping of a machine that is
> down at the moment:
>
> $ /bin/ping -n -i 10 64.28.81.46
> PING 64.28.81.46 (64.28.81.46) from 207.172.135.95 : 56 data bytes
> From 64.14.70.146: Destination Host Unreachable
> From 64.14.70.146: Destination Host Unreachable
> ...
>
> Those error messages come out on stderr. Running under bash, I tried
> piping it to a few commands:
Are you sure? On my system, ping Destination Host Unreachable messages come
on stdout.
[david at uni musicat]$ ping 66.250.33.252 > /tmp/pingout 2> /tmp/pingerr
[david at uni musicat]$ head /tmp/pingout
PING 66.250.33.252 (66.250.33.252) from 66.92.68.235 : 56(84) bytes of data.
More information about the Discuss
mailing list