From owner-svn-src-head@FreeBSD.ORG Sat May 5 09:39:19 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 041801065670; Sat, 5 May 2012 09:39:19 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx07.syd.optusnet.com.au (fallbackmx07.syd.optusnet.com.au [211.29.132.9]) by mx1.freebsd.org (Postfix) with ESMTP id 870348FC1C; Sat, 5 May 2012 09:39:18 +0000 (UTC) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by fallbackmx07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q459dAbm026515; Sat, 5 May 2012 19:39:10 +1000 Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q459d1OR028213 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 5 May 2012 19:39:02 +1000 Date: Sat, 5 May 2012 19:39:01 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Doug Barton In-Reply-To: <4FA438C4.3080701@FreeBSD.org> Message-ID: <20120505192318.T1202@besplex.bde.org> References: <201205041531.q44FVaYF010236@svn.freebsd.org> <20120504182200.GD1604@azathoth.lan> <4FA438C4.3080701@FreeBSD.org> 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: Sat, 05 May 2012 09:39:19 -0000 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 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. > If SIZEFILE is needed elsewhere that's a different matter, but as it is > that's a hot mess. Bruce