From owner-freebsd-hackers Thu Feb 6 15:33:38 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id PAA14935 for hackers-outgoing; Thu, 6 Feb 1997 15:33:38 -0800 (PST) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id PAA14929 for ; Thu, 6 Feb 1997 15:33:36 -0800 (PST) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id QAA19017; Thu, 6 Feb 1997 16:27:28 -0700 From: Terry Lambert Message-Id: <199702062327.QAA19017@phaeton.artisoft.com> Subject: Re: Audible ping response changes to ping.c To: danny@panda.hilink.com.au (Daniel O'Callaghan) Date: Thu, 6 Feb 1997 16:27:28 -0700 (MST) Cc: terry@lambert.org, jgreco@solaria.sol.net, dufault@hda.com, freebsd-hackers@FreeBSD.ORG In-Reply-To: from "Daniel O'Callaghan" at Feb 7, 97 10:15:33 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > > > Well, I can take the sed and sh alternatives as an indication that I > > > should remove the -z flag from tar, but I think I'll just put the -a flag > > > into ping. > > > > The case for the z flag in tar is the installation media argument > > when bootstrapping a new system to run FreeBSD for the first time. > > > > Also, the z flag runs an external compressor/decompressor. By that > > logic, you should call an external "beep" program if you are trying to > > justify adding the flag using "the "rule of similar existing practice". > > Hmmmm. :-) Here is a revised version that transparently provides a "-a" option to the real ping command without adding it to the real ping command: #!/bin/sh # # bping.sh first version was "aping.sh". 8-). # # To use: # mv /sbin/ping /sbin/ping.real # mv bping.sh /sbin/ping # chmod 555 /sbin/ping # ARGS="" BEEP=no PING=ping.real # find -a, if specified while test "x$1" != "x" do if test "x$1" = "x-a" then BEEP=yes else ARGS="$ARGS $1" fi shift done # run the beep or non-beep version if test "$BEEP" = "yes" then $PING $ARGS | while read x do echo "$x" done exit $? else $PING $ARGS exit $? fi # EOF: not reached Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.