From owner-freebsd-questions@FreeBSD.ORG Thu Aug 14 11:36:06 2003 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 2EE5E37B401 for ; Thu, 14 Aug 2003 11:36:06 -0700 (PDT) Received: from remt27.cluster1.charter.net (remt27.cluster1.charter.net [209.225.8.37]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6D38843FCB for ; Thu, 14 Aug 2003 11:36:05 -0700 (PDT) (envelope-from chowse@charter.net) Received: from [66.168.145.25] (HELO moe) by remt27.cluster1.charter.net (CommuniGate Pro SMTP 4.0.6) with ESMTP id 121377652 for freebsd-questions@freebsd.org; Thu, 14 Aug 2003 14:36:04 -0400 From: "Charles Howse" To: Date: Thu, 14 Aug 2003 13:35:59 -0500 Message-ID: <000201c36292$e83d13d0$04fea8c0@moe> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2616 In-Reply-To: <20030814125801.11b0c2d2.nospam@hiltonbsd.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Importance: Normal Subject: RE: Using bc in bash script 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: Thu, 14 Aug 2003 18:36:06 -0000 > > > Sorry I jumped the gun there, the scale is needed for > this to work Not a problem, thanks for working with me! > > The precision is in hundredths of a second as I understand it from > > playing with time(!): > > > > #!/bin/sh > > time_file=tmp.time > > time="time -a -o $time_file" > > $time cat /var/log/messages >/dev/null 2>&1 > > $time cat /var/log/maillog >/dev/null 2>&1 > > awk '{sum+=$1}END{print sum}' $time_file > > rm $time_file > > > > which outputs: > > > > [18:34:03] munk@users /home/munk# sh tmp.sh > > 0.01 > > > > This simple script just times each cat command and appends > the output from > > time to the $time_file, then prints out the sum of the > first columns of > > the time outputs found in the time file. > > > > Just an idea. > > -- > > Jez, > > Your shell script works fine for me, resolving to 100th's of a second. > > Looks like a good answer for Charles :-) > > I still am wondering why the date command does not have a format > string for seconds (down to 100th's) like "+%ss" and also why > the time command stops at 100th's when other programs resolve > time to 5 or 6 decimal places ? > > Thanks for sharing the info, Yes, thanks very much! I'll try that as soon as I finish my break from hanging window blinds for my daughter. (ick!)