From owner-freebsd-chat Tue Oct 19 22:14: 7 1999 Delivered-To: freebsd-chat@freebsd.org Received: from stumpy.dannyland.org (stumpy.dannyland.org [209.157.133.194]) by hub.freebsd.org (Postfix) with ESMTP id 1A2961ABE6 for ; Tue, 19 Oct 1999 22:14:04 -0700 (PDT) (envelope-from dannyman@stumpy.dannyland.org) Received: by stumpy.dannyland.org (Postfix, from userid 1000) id 398193CBD; Tue, 19 Oct 1999 22:14:12 -0700 (PDT) Date: Tue, 19 Oct 1999 22:14:11 -0700 From: dannyman To: David Scheidt Cc: chat@freebsd.org Subject: Re: averaging numbers in a stream Message-ID: <19991019221411.A893@stumpy.dannyland.org> References: <19991019203905.B30514@stumpy.dannyland.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95i In-Reply-To: ; from David Scheidt on Wed, Oct 20, 1999 at 12:12:45AM -0500 X-Loop: djhoward@uiuc.edu X-URL: http://www.dannyland.org/~dannyman/ Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Wed, Oct 20, 1999 at 12:12:45AM -0500, David Scheidt wrote: > yn Tue, 19 Oct 1999, dannyman wrote: > > > to average. Is there a cleaner way to do this, all on one line, with a > > fairly standard Unix shell? In my case, tcsh. > > awk '{ foo += $1} END { print foo/NR}' Smarty pants! :) -d -- dannyman - http://www.dannyland.org/~dannyman/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message