From owner-freebsd-questions@FreeBSD.ORG Wed Oct 27 22:14:18 2004 Return-Path: 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 B85D716A4CE for ; Wed, 27 Oct 2004 22:14:18 +0000 (GMT) Received: from mail.seekingfire.com (coyote.seekingfire.com [24.72.10.212]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6BD8143D1D for ; Wed, 27 Oct 2004 22:14:18 +0000 (GMT) (envelope-from tillman@seekingfire.com) Received: by mail.seekingfire.com (Postfix, from userid 500) id 2C56E54E; Wed, 27 Oct 2004 16:14:18 -0600 (CST) Date: Wed, 27 Oct 2004 16:14:18 -0600 From: Tillman Hodgson To: FreeBSD Questions Message-ID: <20041027221418.GO94897@seekingfire.com> References: <9395922d04102715094411ac2d@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9395922d04102715094411ac2d@mail.gmail.com> X-Habeas-SWE-1: winter into spring X-Habeas-SWE-2: brightly anticipated X-Habeas-SWE-3: like Habeas SWE (tm) X-Habeas-SWE-4: Copyright 2002 Habeas (tm) X-Habeas-SWE-5: Sender Warranted Email (SWE) (tm). The sender of this X-Habeas-SWE-6: email in exchange for a license for this Habeas X-Habeas-SWE-7: warrant mark warrants that this is a Habeas Compliant X-Habeas-SWE-8: Message (HCM) and not spam. Please report use of this X-Habeas-SWE-9: mark in spam to . X-GPG-Key-ID: 828AFC7B X-GPG-Fingerprint: 5584 14BA C9EB 1524 0E68 F543 0F0A 7FBC 828A FC7B X-GPG-Key: http://www.seekingfire.com/gpg_key.asc X-Urban-Legend: There is lots of hidden information in headers User-Agent: Mutt/1.5.6i Subject: Re: getloadavg and source for /usr/bin/uptime X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Oct 2004 22:14:18 -0000 On Wed, Oct 27, 2004 at 11:09:46PM +0100, David Jenkins wrote: > NB - I don't want to pipe uptime into awk or use a perl script etc, > I'd much prefer it to be C based. If you *did* want to do it that way, something like uptime | sed -e 's/.*: \([0-9.]*\).*/\1/' is handy. > If any knows where it's hiding (or why it's not there) I'd be very > grateful if you could share it with me. Probably because /usr/bin/uptime is a hard link to the /usr/bin/w binary. I think you want the code from /usr/src/usr.bin/w/w.c. -T -- "It is not always the same thing to be a good man and a good citizen." -- Nicomachean Ethics, 325 B.C. by Aristotle