From owner-freebsd-current@FreeBSD.ORG Thu May 30 09:48:45 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 81F459AA; Thu, 30 May 2013 09:48:45 +0000 (UTC) (envelope-from schweikh@schweikhardt.net) Received: from rs2.shuttle.de (rs2.shuttle.de [IPv6:2001:638:206:3::8]) by mx1.freebsd.org (Postfix) with ESMTP id 4544BF59; Thu, 30 May 2013 09:48:45 +0000 (UTC) Received: by rs2.shuttle.de (Postfix, from userid 10) id EACA65804B; Thu, 30 May 2013 11:48:43 +0200 (CEST) Received: from hal9000.schweikhardt.net (localhost [127.0.0.1]) by hal9000.schweikhardt.net (8.14.7/8.14.7) with ESMTP id r4U9mWQV000737; Thu, 30 May 2013 11:48:32 +0200 (CEST) (envelope-from schweikh@hal9000.schweikhardt.net) Received: (from schweikh@localhost) by hal9000.schweikhardt.net (8.14.7/8.14.7/Submit) id r4U9mWTC000736; Thu, 30 May 2013 11:48:32 +0200 (CEST) (envelope-from schweikh) Date: Thu, 30 May 2013 11:48:32 +0200 From: Jens Schweikhardt To: Kenta Suzumoto Subject: Re: BSD sleep Message-ID: <20130530094832.GB3053@schweikhardt.net> References: <20130528230140.A5B396F448@smtp.hushmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130528230140.A5B396F448@smtp.hushmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-current@freebsd.org, freebsd-questions@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 09:48:45 -0000 On Tue, May 28, 2013 at 07:01:40PM -0400, Kenta Suzumoto wrote: # Hi. Is there no built-in way of making "sleep" sleep in increments # of minutes, hours, etc? The GNU "sleep" can be invoked like "sleep # 1h" for an hour. The FreeBSD one's manpage leads me to believe we # can only use seconds, which is kind of annoying. Is there an # undocmented or missing feature here? Seems really trivial to # implement. # # ~ $ sleep 1h # usage: sleep seconds Perfection is reached when there is nothing left to take away. The GNU format is already an incompatibility. If I want to sleep longer than 3 digit amount in secs, I do the math. The POSIXly *portable* way to do this and document it for the mathematically challenged is sleep $((2*60*60)) # 2h sleep $((7*24*60*60)) # 1w Regards, Jens -- Jens Schweikhardt http://www.schweikhardt.net/ SIGSIG -- signature too long (core dumped)