From owner-svn-src-head@FreeBSD.ORG Sun May 6 03:15:56 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id BDE25106566B; Sun, 6 May 2012 03:15:56 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from opti.dougb.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 63EAA1502EC; Sun, 6 May 2012 03:15:55 +0000 (UTC) Date: Sat, 5 May 2012 20:15:54 -0700 (PDT) From: Doug Barton To: Bruce Evans In-Reply-To: <20120505192318.T1202@besplex.bde.org> Message-ID: References: <201205041531.q44FVaYF010236@svn.freebsd.org> <20120504182200.GD1604@azathoth.lan> <4FA438C4.3080701@FreeBSD.org> <20120505192318.T1202@besplex.bde.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-message-flag: Outlook -- Not just for spreading viruses anymore! OpenPGP: id=1A1ABC84 Organization: http://SupersetSolutions.com/ MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Baptiste Daroussin , "src-committers@freebsd.org" , Garrett Cooper , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , "kmoore@freebsd.org" , Josh Paetzel Subject: Re: svn commit: r235005 - head/usr.sbin/pc-sysinstall/backend X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 May 2012 03:15:56 -0000 On Sat, 5 May 2012, Bruce Evans wrote: > On Fri, 4 May 2012, Doug Barton wrote: > >> On 05/04/2012 11:22 AM, Baptiste Daroussin wrote: >>>>>>> fetch -s "${FETCHFILE}" >${SIZEFILE} >>>>>>> SIZE="`cat ${SIZEFILE}`" >>>>>>> - SIZE="`expr ${SIZE} / 1024`" >>>>>>> + SIZE=$((SIZE/1024)) >>>>> >>>>> Bug; should be '$SIZE/' >>> No this is perfectly valid >> >> Yes, that works, but it's not our usual style. However, the point is >> moot as that whole block should be reduced down to: >> >> SIZE=$(( `fetch -s "${FETCHFILE}"` / 1024 )) > > The KNF rule that there shall be spaces around binary operators should > probably apply in shell expressions too, but I don't like the spaces > on 1 side of (( and )). Shell syntax doesn't even allow spaces between > '$' ((. The "extra" spaces there are a personal style thing. I do it for 2 reasons, readability primarily, but also to distinguish arithmetic operations from $(command) style. > The rc.d style seems to be to use backquotes and not use $(cmd), but I > prefer the opposite except possibly in shell expressions like the above > so that it is easier to separate the commands from the shell expressions. Yeah, backticks over $() is also a personal style issue, for no particular good reason other than "looks better to me." :) Doug -- It's always a long day; 86400 doesn't fit into a short. Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/