From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 108687 invoked by alias); 11 Sep 2015 02:05:16 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 108567 invoked by uid 89); 11 Sep 2015 02:05:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=4.2 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,KAM_THEBAT,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: smtp.ht-systems.ru Received: from smtp.ht-systems.ru (HELO smtp.ht-systems.ru) (78.110.50.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 11 Sep 2015 02:05:13 +0000 Received: from [95.165.144.62] (helo=darkdragon.lan) by smtp.ht-systems.ru with esmtpa (Exim 4.80.1) (envelope-from ) (Authenticated sender: postmaster@rootdir.org) id 1ZaDi6-0003QO-M1 ; Fri, 11 Sep 2015 05:05:06 +0300 Received: from [192.168.1.10] (HELO daemon2.darkdragon.lan) by daemon2 (Office Mail Server 0.8.12 build 08053101) with SMTP; Fri, 11 Sep 2015 02:00:28 -0000 Date: Fri, 11 Sep 2015 02:05:00 -0000 From: Andrey Repin Reply-To: cygwin@cygwin.com Message-ID: <1868430.20150911050028@yandex.ru> To: Eric Blake , cygwin@cygwin.com Subject: Re: Group Permissions on root folders problem (Windows 10 TP build 10061) In-Reply-To: <55F22D2E.3070801@redhat.com> References: <20150616155843.GE31537@calimero.vinschen.de> <20150905155916.8403bea8d4f631c1f7a314e3@nifty.ne.jp> <20150906114444.GA27066@calimero.vinschen.de> <20150910200439.bf06449af4f1e6efcb76676e@nifty.ne.jp> <20150910172348.GB26699@calimero.vinschen.de> <55F1BD86.1090001@redhat.com> <20150910173128.GD26699@calimero.vinschen.de> <55F1BF8A.2050907@redhat.com> <719333680.20150911033936@yandex.ru> <55F22D2E.3070801@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-09/txt/msg00172.txt.bz2 Greetings, Eric Blake! >>>>> [ ... -a ... ] is not portable; there are some inherently ambiguous >>>>> situations that it cannot handle. POSIX recommends that you spell it [ >>>>> ... ] && [ ... ] instead. >>>> >> >> If a script author did not quote the indirect references, it is their fault, > No, even with proper quoting, the use of -a and -o creates ambiguous > situations. For example, a naive read would claim that > test "$var1" -a "$var2" > sets $? to 0 only if both "$var1" and "$var2" are non-empty. But > according to the POSIX rules, if $var1 is '!' and $var2 is '', then this > MUST be treated as the negation of the unary operator '-a "$var2"', if > the shell has a unary -a (bash does, dash does not). And in bash's > case, '-a ""' is false (the empty string never exists as a file), so the > negation is true, and you have a case where the -a version returned 0 in > spite of one of the inputs being empty. That's... great. At the very least, we have a standard we can rely... refer... to... >.< sigh. Thanks for your thorough explanation, much appreciated! (And I have a set of scripts to rewrite...) -- With best regards, Andrey Repin Friday, September 11, 2015 04:58:51 Sorry for my terrible english... -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple