From owner-freebsd-questions@freebsd.org Mon Nov 6 19:15:41 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 05A6AE65A3D for ; Mon, 6 Nov 2017 19:15:41 +0000 (UTC) (envelope-from mfv@bway.net) Received: from smtp1.bway.net (smtp1.v6.bway.net [IPv6:2607:d300:1::27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D83387FC67 for ; Mon, 6 Nov 2017 19:15:40 +0000 (UTC) (envelope-from mfv@bway.net) Received: from gecko4 (host-216-220-115-213.dsl.bway.net [216.220.115.213]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: m1316v@bway.net) by smtp1.bway.net (Postfix) with ESMTPSA id 0CBB395868; Mon, 6 Nov 2017 14:15:31 -0500 (EST) Date: Mon, 6 Nov 2017 14:15:30 -0500 From: mfv To: Tim Daneliuk Cc: Ernie Luzar , "freebsd-questions@freebsd.org" Subject: Re: how to code a timer loop in a sh script Message-ID: <20171106141530.22611a51@gecko4> In-Reply-To: References: <5A00A826.2000501@gmail.com> Reply-To: mfv@bway.net MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 19:15:41 -0000 > On Mon, 2017-11-06 at 12:24 Tim Daneliuk > wrote: > >On 11/06/2017 12:21 PM, Ernie Luzar wrote: >> Trying to write a sh script that will run continually and every 10 >> minutes issue a group of commands. Been trying to use the wait >> command and the while loop command to achieve the desired effect >> with no joy. Would like an example of a wait loop code to see how >> its done. >> >> Thanks for any help. >> _______________________________________________ >> freebsd-questions@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/freebsd-questions >> To unsubscribe, send any mail to >> "freebsd-questions-unsubscribe@freebsd.org" > >while [ 1 = 1 ] >do > command > command > ... > sleep 600 >done > Hello, It is also possible to use the ":" command as part of the loop. Thus, while : do command command ... sleep 600 done In other words replace "[ 1 = 1 ]" with a single colon ":". According to "man 1 sh": : A null command that returns a 0 (true) exit value. Cheers ... Marek