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
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
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
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
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 [
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
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?
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 [
$ 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