From owner-freebsd-questions@FreeBSD.ORG Thu Aug 14 09:55:04 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 C51F937B404 for ; Thu, 14 Aug 2003 09:55:04 -0700 (PDT) Received: from hauptpostamt.charite.de (hauptpostamt.charite.de [193.175.66.220]) by mx1.FreeBSD.org (Postfix) with ESMTP id B0CBD43FCB for ; Thu, 14 Aug 2003 09:55:03 -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 9C74D15C00C; Thu, 14 Aug 2003 18:54:43 +0200 (CEST) Received: from chaplin.charite.de (chaplin.str.charite.de [192.168.202.88]) by postamt1.charite.de (Postfix) with ESMTP id 66873633AD; Thu, 14 Aug 2003 18:54:43 +0200 (CEST) Message-Id: <5.2.0.9.1.20030814184546.01a9b688@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:49:20 +0200 To: "Charles Howse" , From: Alexander Haderer In-Reply-To: <002301c36283$8a8a40a0$04fea8c0@moe> References: <87d6f89oya.fsf@pooh.honeypot.net> 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:55:05 -0000 At 11:45 14.08.2003 -0500, Charles Howse wrote: > > > Can I refine it to give me something like: .784 seconds? > > > > Use "bc -l" instead of bc. That should do it. > >No, that still gives 0 seconds. > >I think this whole thing is dependent on the fact that `date +%s` >reports integers. > >I'm still interested in something like .874 seconds, but for the time >being, I'll just use an if..then..else to say "less than 1 second" or >the actual number of seconds. > >I've looked at the time command suggested by Jez, haven't tried it yet. Note the trap: shell's builtin "time" command differs somewhat from installed "/usr/bin/time"! man time man builtin man Alexander