From owner-freebsd-questions@FreeBSD.ORG Fri Mar 26 06:15:49 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 EEA4716A4CE for ; Fri, 26 Mar 2004 06:15:49 -0800 (PST) Received: from mail.u4eatech.com (blackhole.u4eatech.com [195.188.241.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id E690143D45 for ; Fri, 26 Mar 2004 06:15:48 -0800 (PST) (envelope-from richard.williamson@u4eatech.com) Received: (from filter@localhost) by mail.u4eatech.com (8.11.6/8.11.6) id i2QEFRo28608; Fri, 26 Mar 2004 14:15:27 GMT X-Authentication-Warning: mail.u4eatech.com: filter set sender to richard.williamson@u4eatech.com using -f Received: from apus.u4eatech.com (unknown [172.30.20.100]) by mail.u4eatech.com (Postfix) with ESMTP id 3786F1577D4; Fri, 26 Mar 2004 14:15:24 +0000 (GMT) Message-Id: <6.0.3.0.2.20040326140911.025b5cc0@cygnus> X-Sender: richard@cygnus X-Mailer: QUALCOMM Windows Eudora Version 6.0.3.0 Date: Fri, 26 Mar 2004 14:18:38 +0000 To: Jan Grant From: "Richard P. Williamson" In-Reply-To: References: <6.0.3.0.2.20040326103618.025871c0@cygnus> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, hits=-6.3 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,REFERENCES, REPLY_WITH_QUOTES version=2.55 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: freebsd-questions@freebsd.org Subject: Re: sleeping for 30 seconds 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: Fri, 26 Mar 2004 14:15:50 -0000 At 13:08 26/03/2004, Jan Grant wrote: >On Fri, 26 Mar 2004, Richard P. Williamson wrote: > >You might, if the possibility is there, want to use the exit value of >the main process to indicate errors, which is perhaps a little more >reliable. Except it doesn't tell me how long it ran for before it falling over, which is the bit I need to look at. >If you want the time in seconds between two points, you might try >something like this: > > start_time=`date +%s` > # ... do something > end_time=`date +%s` > time_taken=$(($end_time - $start_time)) That's what I'm looking for, thanks! (that, and ) if [ $time_taken -lt 10 ]; then sleep 50 fi Regards, and thanks! rip