From owner-freebsd-questions Fri Aug 3 16:22: 1 2001 Delivered-To: freebsd-questions@freebsd.org Received: from cactus.fi.uba.ar (cactus.fi.uba.ar [157.92.49.108]) by hub.freebsd.org (Postfix) with ESMTP id E2C4337B401 for ; Fri, 3 Aug 2001 16:21:53 -0700 (PDT) (envelope-from fgleiser@cactus.fi.uba.ar) Received: from cactus.fi.uba.ar (cactus.fi.uba.ar [157.92.49.108]) by cactus.fi.uba.ar (8.11.3/8.9.3) with ESMTP id f73NI3Z81045; Fri, 3 Aug 2001 20:18:03 -0300 (ART) (envelope-from fgleiser@cactus.fi.uba.ar) Date: Fri, 3 Aug 2001 20:18:03 -0300 (ART) From: Fernando Gleiser To: BSD Freak Cc: FreeBSD Questions Subject: Re: Adding Number in a File In-Reply-To: Message-ID: <20010803201522.T73395-100000@cactus.fi.uba.ar> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, 4 Aug 2001, BSD Freak wrote: > I want to add up all the numbers on each line of this file and output > the sum to standard output. > > Any ideas how to do this ?? awk '{tot+=$1}; END {print tot}' path-to-your-file Fer To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message