From owner-freebsd-questions Wed Aug 14 8:25:13 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A727337B400 for ; Wed, 14 Aug 2002 08:25:11 -0700 (PDT) Received: from mail.seekingfire.com (coyote.seekingfire.com [24.72.10.212]) by mx1.FreeBSD.org (Postfix) with ESMTP id 47B5443E6E for ; Wed, 14 Aug 2002 08:25:11 -0700 (PDT) (envelope-from tillman@seekingfire.com) Received: from blues.seekingfire.prv (blues.seekingfire.prv [192.168.23.211]) by mail.seekingfire.com (Postfix) with ESMTP id D7EC416E for ; Wed, 14 Aug 2002 09:25:10 -0600 (CST) Received: (from tillman@localhost) by blues.seekingfire.prv (8.11.6/8.11.6) id g7EFPGg12055 for freebsd-questions@FreeBSD.ORG; Wed, 14 Aug 2002 09:25:16 -0600 Date: Wed, 14 Aug 2002 09:25:16 -0600 From: Tillman Hodgson To: freebsd-questions@FreeBSD.ORG Subject: Re: Extracting the 1-minute loadavg in a portable yet low-impact fashion Message-ID: <20020814092516.D11913@seekingfire.com> References: <20020814083253.C11913@seekingfire.com> <20020814144729.GA50066@dan.emsphone.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20020814144729.GA50066@dan.emsphone.com>; from dnelson@allantgroup.com on Wed, Aug 14, 2002 at 09:47:29AM -0500 X-Urban-Legend: There is lots of hidden information in headers 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 Wed, Aug 14, 2002 at 09:47:29AM -0500, Dan Nelson wrote: > In the last episode (Aug 14), Tillman Hodgson said: > > uptime | awk '{print $10}' works, but leaves a trailing comma. Adding > > a sed statement to the end of that would start to get too expensive. > > That actually won't work, since if the system has been up for under an > hour, you get > > 9:43AM up 28 mins, 6 users, load averages: 0.28, 0.67, 0.43 > > How about uptime | sed -e 's/.*: \([0-9.]*\).*/\1/' ? That should work > on any system where the loadavg is immediately preceded by ": ", which > is every OS I can lay my hands on at the moment. Works on every OS I have available too, thanks muchly :-) - Tillman -- Act without doing, work without effort. Tao Te Ching To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message