From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeremy Fitzhardinge Subject: Re: [PATCH 1/2] Make xencommons a bit more idiomatic Date: Tue, 30 Aug 2011 10:47:26 -0700 Message-ID: <4E5D222E.2040208@goop.org> References: <4E4F0480.6030404@goop.org> <20061.4783.289388.358884@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20061.4783.289388.358884@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Jackson Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On 08/30/2011 09:41 AM, Ian Jackson wrote: > Jeremy Fitzhardinge writes ("[Xen-devel] [PATCH 1/2] Make xencommons a bit more idiomatic"): >> Signed-off-by: Jeremy Fitzhardinge > ... >> -if test "x$1" = xstart && \ >> - test -d /proc/xen && \ >> - ! test -f /proc/xen/capabilities && \ >> - ! grep '^xenfs ' /proc/mounts >/dev/null; >> -then >> +if [ "x$1" = xstart -a -d /proc/xen -a \ >> + ! -f /proc/xen/capabilities ] && \ >> + ! grep -qw '^xenfs' /proc/mounts; then >> mount -t xenfs xenfs /proc/xen > I'm afraid I'm reluctant to accept this purely stylistic change. I > might if it seemed to me to be a clear improvement, but I don't think > that's the case. > > If anything we should be moving towards the use of && rather than -a, > as that is harmless and will make the script depend less on /bin/bash. No, you've misread it. I'm changing it to use test for all the file-existence checks in it's idiomatic form of '[', which implements -a. It is not at all bash-specific. J