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 c...@case.edu http://tiswww.cwru.edu/~chet/