From owner-freebsd-questions@FreeBSD.ORG Thu Aug 14 09:50:37 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 6B0D337B401 for ; Thu, 14 Aug 2003 09:50:37 -0700 (PDT) Received: from hauptpostamt.charite.de (hauptpostamt.charite.de [193.175.66.220]) by mx1.FreeBSD.org (Postfix) with ESMTP id 62F8343F93 for ; Thu, 14 Aug 2003 09:50:36 -0700 (PDT) (envelope-from alexander.haderer@charite.de) Received: from postamt1.charite.de (postamt1.charite.de [193.175.66.246]) by hauptpostamt.charite.de (Postfix) with ESMTP id 4780A15C027; Thu, 14 Aug 2003 18:50:26 +0200 (CEST) Received: from chaplin.charite.de (chaplin.str.charite.de [192.168.202.88]) by postamt1.charite.de (Postfix) with ESMTP id 1F22F633B3; Thu, 14 Aug 2003 18:50:26 +0200 (CEST) Message-Id: <5.2.0.9.1.20030814183506.01a82ef8@postamt1.charite.de> X-Sender: afrika@postamt1.charite.de X-Mailer: QUALCOMM Windows Eudora Version 5.2.0.9 Date: Thu, 14 Aug 2003 18:45:03 +0200 To: Kirk Strauser , freebsd-questions@freebsd.org From: Alexander Haderer In-Reply-To: <87d6f89oya.fsf@pooh.honeypot.net> References: <001a01c3627e$487d7a10$04fea8c0@moe> <001a01c3627e$487d7a10$04fea8c0@moe> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Virus-Scanned: by amavisd-new at charite.de 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 16:50:37 -0000 At 11:35 14.08.2003 -0500, Kirk Strauser wrote: >At 2003-08-14T16:08:21Z, "Charles Howse" writes: > > > Can I refine it to give me something like: .784 seconds? > >Use "bc -l" instead of bc. That should do it. Yes, but not in the context mentioned before: > > > Start_time=`date +%s` # Seconds past midnight at start of script > > > [ do lots of stuff ] > > > End_time=`date +%s` # Seconds past midnight at end of script et=`echo "$end_time - $start_time" | bc -l` Here bc -l will not really help, because date +%s returns whole seconds :-( BTW: %s are seconds since epoch Alexander