From owner-freebsd-pkg@freebsd.org Thu Feb 16 20:26:51 2017 Return-Path: Delivered-To: freebsd-pkg@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 07756CE2EC2 for ; Thu, 16 Feb 2017 20:26:51 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id DDAAA147D for ; Thu, 16 Feb 2017 20:26:50 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: by mailman.ysv.freebsd.org (Postfix) id DA135CE2EC1; Thu, 16 Feb 2017 20:26:50 +0000 (UTC) Delivered-To: pkg@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 D9B22CE2EC0 for ; Thu, 16 Feb 2017 20:26:50 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 852CF147C; Thu, 16 Feb 2017 20:26:49 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id eSdac3S8nsa1keSdbcVbJu; Thu, 16 Feb 2017 13:26:49 -0700 X-Authority-Analysis: v=2.2 cv=W+NIbVek c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=8nJEP1OIZ-IA:10 a=n2v9WMKugxEA:10 a=BWvPGDcYAAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=fb8FV7DgwyWN-Pdx0-QA:9 a=wPNLvfGTeEIA:10 a=pxhY87DP9d2VeQe4joPk:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id 6329DD6E; Thu, 16 Feb 2017 12:26:46 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v1GKQivr096824; Thu, 16 Feb 2017 12:26:45 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201702162026.v1GKQivr096824@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= cc: Cy Schubert , Alan Somers , scrappy@freebsd.org, Brian Somers , freebsd-bugzilla@ayaken.net, Cy Schubert , pkg@freebsd.org Subject: Re: Bug 217055 - Consolidate random sleeps in periodic scripts In-Reply-To: Message from =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= of "Thu, 16 Feb 2017 10:02:02 +0100." <86zihmwlth.fsf@desk.des.no> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Date: Thu, 16 Feb 2017 12:26:44 -0800 X-CMAE-Envelope: MS4wfGTD4hrJZnfyQbOyxA2kan0qp0XdW2VrH9UoBZjGY6clnF+Mmg4XogCfmqndCu1+ZVaPbCLiiOJsyv9K3vdV9HISrMkH1jRQtW6sbauBe7x6Mdf96c8Y 4X+M53Ch5aK51GKSOfF71SwaKs5pxYVnw8GQgMbWjNHTLpUOaI/A3S0N/dob3xez7l2PxiyeHv63DgzsEwrPaymL4N2qTsxgdHBO/Z+v8PDitUvsZhie3rDf cEqI/JMDPQMMErVCT1P5l6/QLKuP7dUgk8QaVL4WjGxsQQeyhgBzTz53Y16w1zGY8KZins6WjLZT7Sb8P0Jf+NvhlXlxLoxKcDqaV4N6Nqg= X-BeenThere: freebsd-pkg@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Binary package management and package tools discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 20:26:51 -0000 In message <86zihmwlth.fsf@desk.des.no>, =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav? = w rites: > Cy Schubert writes: > > "Dag-Erling Smørgrav" writes: > > > This won't work, because && forks. You need: > > > > > > if [ -t 0 ] ; then ... ; fi > > Are you sure? > > Maybe it varies from shell to shell... or maybe I confused it with > other constructs like 'grep foo bar | while read line' (which definitely > doesn't work). I consider it bad style, but that's a matter of taste. > I prefer to use && and || only for error conditions and loop control. Maybe. I tested this on Bourne, ksh, bash, zsh, csh and 44bsd-csh on FreeBSD and bash on Linux. I don't have access to any Solaris or AT&T servers any more. (I am told that Solaris 11 replaced /bin/sh with bash.) If the command after a test is a one-liner, like my proposed patch, then I prefer to put it on the same line. If it's more than one line then it should go in an if block. Otherwise it's ugly and hard to follow. Just a difference in preference I suppose. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few.