From owner-freebsd-bugs Thu Apr 25 4:50: 9 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 7AEEF37B41A for ; Thu, 25 Apr 2002 04:50:05 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g3PBo5U33223; Thu, 25 Apr 2002 04:50:05 -0700 (PDT) (envelope-from gnats) Date: Thu, 25 Apr 2002 04:50:05 -0700 (PDT) Message-Id: <200204251150.g3PBo5U33223@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Edwin Groothuis Subject: Re: bin/37442: [PATCH] sleep.c to support time multipliers Reply-To: Edwin Groothuis Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/37442; it has been noted by GNATS. From: Edwin Groothuis To: Peter Pentchev Cc: bug-followup@FreeBSD.org Subject: Re: bin/37442: [PATCH] sleep.c to support time multipliers Date: Thu, 25 Apr 2002 21:46:13 +1000 On Thu, Apr 25, 2002 at 02:07:17PM +0300, Peter Pentchev wrote: > On Thu, Apr 25, 2002 at 03:49:24PM +1000, Edwin Groothuis wrote: > > > > >Number: 37442 > > >Category: bin > > >Synopsis: [PATCH] sleep.c to support time multipliers > > >Originator: Edwin Groothuis > > >Description: > > > > I want to run my nightly downloads run in an xterm, so I can check > > if they've run properly. Often I have to delay them for hours and > > am now pretty good skilled in the multiplication table of 1800, but > > now and then things are one hour off. To solve this, I've modified > > sleep(1) to support multipliers: sleep 1h will sleep for one hour, > > sleep 2.5m will sleep for two and a half minute. > > Mmm... not to knock your patch down, but.. you do realize that > this can be done with expr(1) and/or shell built-in arithmetic > functions (ksh and bash have $((5 * 1800)), don't know about > other shells), right? Yes I know, that's what I did in the beginning. But I also know that its easier to write (and make sure it's correct) '2.5h' than '9000' (or echo ((5 * 1800)), which puts you in the situation that you're thinking in 5 half hours instead of 2.5 hours (which is the same in timespan but not how an average person thinks)). Edwin -- Edwin Groothuis | Personal website: http://www.MavEtJu.org edwin@mavetju.org | Interested in MUDs? Visit Fatal Dimensions: bash$ :(){ :|:&};: | http://www.FatalDimensions.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message