[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Docco
From: |
Andreas Kähäri |
Subject: |
Re: Docco |
Date: |
Wed, 27 Mar 2024 10:28:55 +0100 |
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 [ specific
> vs [[ specific for instance
>
> -a file
> True if file exists ([[ only, for [ see test builtin)
>
> This to avoid things like
>
> $ [ -a /tmp ] && echo ok || echo nok
> ok
> $ [ ! -a /tmp ] && echo ok || echo nok
> ok
>
> I know it is obvious, unless this is intended to force a complete
> multi-pass man read...
Would it not be untrue to say that "-a" is specific to "[[", as it is
clearly not the case? The fact that it is easy to confuse the two is
a different matter, but the documentation is correct for the current
implementation (which mimics the ksh shell with regards to the unary
"-a" operator).
--
Andreas (Kusalananda) Kähäri
Uppsala, Sweden
.
- Docco, Phi Debian, 2024/03/27
- Re: Docco,
Andreas Kähäri <=
- Re: Docco, Greg Wooledge, 2024/03/27
- Re: Docco, Chet Ramey, 2024/03/27