delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/09/10/22:05:34

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:reply-to:message-id:to:subject
:in-reply-to:references:mime-version:content-type
:content-transfer-encoding; q=dns; s=default; b=Jt+ENnlOJUWmiDQG
oNQzFP4mn89WTkEVKHqpRY+oIaRMAXrH/2HK01Q+fsy4mi/xQaJB8PteN8VtaTza
5zH/2EGaSC/20opMZ1dN+8Ifqj/nKZuljtL0UW+y7eTvfY14WVK9KVkE3NoZQgDj
sWmh62dWgQ/c7VoEf6GizSxXSJI=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:reply-to:message-id:to:subject
:in-reply-to:references:mime-version:content-type
:content-transfer-encoding; s=default; bh=K6zVAy1CA1xeL38e8ge1dB
QmxKU=; b=m9D7fF8jdFB74oTz0B998jJzhruweSbdv0f/eAZY0jaw86Rcy11/Xj
rQ9r7FaW9hswLPbkHz2dn4fpoAnPgiWkvm86dkrIKb2XFkn8qqFzqCDXUpGZzVkf
1gisJuXqypEd8HNdtsOtdwj7bHDtbn/ive90KLCWLRPu1qErnJK9c=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
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
Date: Fri, 11 Sep 2015 05:00:28 +0300
From: Andrey Repin <anrdaemon AT yandex DOT ru>
Reply-To: cygwin AT cygwin DOT com
Message-ID: <1868430.20150911050028@yandex.ru>
To: Eric Blake <eblake AT redhat DOT com>, cygwin AT cygwin DOT com
Subject: Re: Group Permissions on root folders problem (Windows 10 TP build 10061)
In-Reply-To: <55F22D2E.3070801@redhat.com>
References: <CAMH9mcFEL3mao+m-DEYM84kC1HOPeSBpZXD+mDf0USobF9oY7g AT mail DOT gmail DOT com> <CAMH9mcFOKjvjiFvvk1ju0ZxBDK28MaktdnYwj5_CjvbgnpVO4A AT mail DOT gmail DOT com> <20150616155843 DOT GE31537 AT calimero DOT vinschen DOT de> <20150905155916 DOT 8403bea8d4f631c1f7a314e3 AT nifty DOT ne DOT jp> <20150906114444 DOT GA27066 AT calimero DOT vinschen DOT de> <20150910200439 DOT bf06449af4f1e6efcb76676e AT nifty DOT ne DOT jp> <20150910172348 DOT GB26699 AT calimero DOT vinschen DOT de> <55F1BD86 DOT 1090001 AT redhat DOT com> <20150910173128 DOT GD26699 AT calimero DOT vinschen DOT de> <55F1BF8A DOT 2050907 AT redhat DOT com> <719333680 DOT 20150911033936 AT yandex DOT ru> <55F22D2E DOT 3070801 AT redhat DOT com>
MIME-Version: 1.0
X-IsSubscribed: yes

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019