bug-bash
[Top][All Lists]
Advanced

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

Re: parameter expansion null check fails for arrays when [*] or [@] is u


From: Robert Elz
Subject: Re: parameter expansion null check fails for arrays when [*] or [@] is used
Date: Wed, 23 Mar 2022 19:26:02 +0700

    Date:        Wed, 23 Mar 2022 07:38:39 -0400
    From:        Greg Wooledge <greg@wooledge.org>
    Message-ID:  <YjsGv/n4WGJuyZ2j@wooledge.org>

  | But as it happens, the writers of the POSIX standards *did* use that
  | word in some places, and so we have to live with it.

The usage much predates POSIX or any of the previous standards.
It is how it was originally documented.

  | Back to the original topic, I have absolutely no idea what "${a[@]:+word}"
  | is supposed to do.

Nor do I.   It might mean $# -ne 0 (or in this context ${#a} -ne 0)
or it might mean similar to
        for f in ${a[@]}
        do
                test [ "$f" ] && return 0
        done
        return 1
or something else entirely.

kre




reply via email to

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