From owner-freebsd-questions@freebsd.org Mon Nov 6 20:38:28 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AD5FE673B4 for ; Mon, 6 Nov 2017 20:38:28 +0000 (UTC) (envelope-from tundra@tundraware.com) Received: from oceanview.tundraware.com (oceanview.tundraware.com [45.55.60.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailman.tundraware.com", Issuer "mailman.tundraware.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 111C21336 for ; Mon, 6 Nov 2017 20:38:27 +0000 (UTC) (envelope-from tundra@tundraware.com) Received: from [192.168.43.6] (mobile-166-175-63-174.mycingular.net [166.175.63.174]) (authenticated bits=0) by oceanview.tundraware.com (8.15.2/8.15.2) with ESMTPSA id vA6KcL4r007567 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 6 Nov 2017 14:38:23 -0600 (CST) (envelope-from tundra@tundraware.com) Subject: Re: how to code a timer loop in a sh script To: markham breitbach , "freebsd-questions@freebsd.org" References: <5A00A826.2000501@gmail.com> From: Tim Daneliuk Message-ID: Date: Mon, 6 Nov 2017 14:38:11 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (oceanview.tundraware.com [45.55.60.57]); Mon, 06 Nov 2017 14:38:23 -0600 (CST) X-TundraWare-MailScanner-Information: Please contact the ISP for more information X-TundraWare-MailScanner-ID: vA6KcL4r007567 X-TundraWare-MailScanner: Found to be clean X-TundraWare-MailScanner-SpamCheck: not spam (whitelisted), SpamAssassin (not cached, score=-0.964, required 1, autolearn=not spam, ALL_TRUSTED -1.00, AWL 0.04) X-TundraWare-MailScanner-From: tundra@tundraware.com X-Spam-Status: No X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 20:38:28 -0000 On 11/06/2017 12:28 PM, markham breitbach wrote: > Any reason not to use cron for this? I don't know the OP's use case, but one reason to NOT use cron is that it's hard to maintain state information across iterations. In an infinite loop as a number of us have described, the script can keep track of state as each iteration executes, to be used by the next iteration. While that's possible across cron invocations, it's generally a lot uglier to to .... -- ---------------------------------------------------------------------------- Tim Daneliuk tundra@tundraware.com PGP Key: http://www.tundraware.com/PGP/