bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Docco


From: Chet Ramey
Subject: Re: Docco
Date: Wed, 27 Mar 2024 08:55:55 -0400
User-agent: Mozilla Thunderbird

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

All the unary and binary primaries described there are available with both
`[[' and `test'.


        -a file
               True if file exists ([[ only, for [ see test builtin)

This would not be accurate. `-a' is deprecated but still accepted as a
unary primary.


This to avoid things like

$ [   -a /tmp ] && echo ok || echo nok
ok
$ [ ! -a /tmp ] && echo ok || echo nok
ok

`test' works on the number of arguments, so these can be expected to be
different.

I know it is obvious, unless this is intended to force a complete
multi-pass man read...

The [[ and test descriptions document the differences.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]