Re: Docco

2024-03-27 Thread Chet Ramey
On 3/27/24 7:40 AM, Andreas Schwab wrote: The check for whether the first argument is '!' is not performed, because the "$2 is a binary primary" check comes first. This is how POSIX documents it. FWIW, ksh parses it the other way round: $ ksh93 -c '[ ! -a /tmp ]; echo $?; [ . -a /tmp ]; echo

Re: Docco

2024-03-27 Thread Chet Ramey
t to 'test expr' (at 92%) to discover the whole thing about -a vs -e (same for other options), a little heads up when quick reading directly at 'CONDITIONAL EXPRESSIONS' would not hurt and not jeopardise the docco semantic I guess? This is from the first paragraph of CONDITION

Re: Docco

2024-03-27 Thread Chet Ramey
On 3/27/24 5:00 AM, Phi Debian wrote: $ man bash ... CONDITIONAL EXPRESSIONS ... -a file True if file exists. -e file True if file exists. ... 'May be' would be nice for newbies to precise which options are [ specific vs [[ specific for instance A

Re: Docco

2024-03-27 Thread Andreas Schwab
On Mär 27 2024, Greg Wooledge wrote: >> $ [ ! -a /tmp ] && echo ok || echo nok >> ok > > Here, you have three arguments, and argument 2 is a "binary primary" > (POSIX wording again), so it's treated as if you had written this: > > [ ! ] && [ /tmp ] && echo ok || echo nok > > This is simply per

Re: Docco

2024-03-27 Thread Greg Wooledge
On Wed, Mar 27, 2024 at 10:00:06AM +0100, Phi Debian wrote: > $ man bash > ... > CONDITIONAL EXPRESSIONS > ... > >-a file > True if file exists. >-e file > True if file exists. > ... > > 'May be' would be nice for newbies to precise which options are [

Re: Docco

2024-03-27 Thread Phi Debian
Interestingly, the ksh docco say that 'Conditional Expressions' applies to [[ only :-) and then say the -a is obsolete. test expression later says the -a and -o binary oper- ators can be used, but they are fraught with pitfalls due to grammatical a

Re: Docco

2024-03-27 Thread Phi Debian
thing about -a vs -e (same for other options), a little heads up when quick reading directly at 'CONDITIONAL EXPRESSIONS' would not hurt and not jeopardise the docco semantic I guess?

Re: Docco

2024-03-27 Thread Andreas Kähäri
On Wed, Mar 27, 2024 at 10:00:06AM +0100, Phi Debian wrote: > $ man bash > ... > CONDITIONAL EXPRESSIONS > ... > >-a file > True if file exists. >-e file > True if file exists. > ... > > 'May be' would be nice for newbies to precise which options are [

Docco

2024-03-27 Thread Phi Debian
$ man bash ... CONDITIONAL EXPRESSIONS ... -a file True if file exists. -e file True if file exists. ... 'May be' would be nice for newbies to precise which options are [ specific vs [[ specific for instance -a file True if file exis