*BSD News Article 21277


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!elroy.jpl.nasa.gov!usc!howland.reston.ans.net!europa.eng.gtefsd.com!uunet!optigfx!optigfx.com
From: mrm@optigfx.com (Mike Murphy)
Newsgroups: comp.os.386bsd.development
Subject: modification to /sbin/ping
Message-ID: <1868@optigfx.optigfx.com>
Date: 21 Sep 93 21:48:00 GMT
Sender: mrm@optigfx.optigfx.com
Lines: 26


If the line that contains

  exit(0);

in the source for ping.c were changed to

  if(nreceived)
    exit(0);
  else
    exit(1);

then shell constructs such as

  if /sbin/ping -c1 blort >/dev/null 2>&1
  then
    echo I can reach blort
  else
    echo blort is not paying attention
  fi
  
would work. This would be convenient.

I'm hesitant to suggest this change because the last
few people who suggested that behavior other than
stock BSD might be good were burned at the stake...