Date: Thu, 25 Apr 2002 04:50:05 -0700 (PDT) From: Edwin Groothuis <edwin@mavetju.org> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/37442: [PATCH] sleep.c to support time multipliers Message-ID: <200204251150.g3PBo5U33223@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/37442; it has been noted by GNATS. From: Edwin Groothuis <edwin@mavetju.org> To: Peter Pentchev <roam@ringlet.net> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200204251150.g3PBo5U33223>