This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Group Permissions on root folders problem (Windows 10 TP build 10061)
- From: Andrey Repin <anrdaemon at yandex dot ru>
- To: Eric Blake <eblake at redhat dot com>, cygwin at cygwin dot com
- Date: Fri, 11 Sep 2015 05:00:28 +0300
- Subject: Re: Group Permissions on root folders problem (Windows 10 TP build 10061)
- Authentication-results: sourceware.org; auth=none
- 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>
- Reply-to: cygwin at cygwin dot com
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