Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #15717
| Path | csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail |
|---|---|
| From | Chet Ramey <chet.ramey@case.edu> |
| Newsgroups | gnu.bash.bug |
| Subject | Re: Two states of empty arrays |
| Date | Thu, 12 Dec 2019 14:13:12 -0500 |
| Lines | 28 |
| Approved | bug-bash@gnu.org |
| Message-ID | <mailman.740.1576178010.1979.bug-bash@gnu.org> (permalink) |
| References | <c9224e23-ff7d-ba84-dc4f-aa68db902f72@noiraude.net> <79b6365d-4c09-7122-25c3-4564fd304948@case.edu> |
| Reply-To | chet.ramey@case.edu |
| NNTP-Posting-Host | lists.gnu.org |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8; format=flowed |
| Content-Transfer-Encoding | 8bit |
| X-Trace | usenet.stanford.edu 1576178010 31510 209.51.188.17 (12 Dec 2019 19:13:30 GMT) |
| X-Complaints-To | action@cs.stanford.edu |
| Cc | chet.ramey@case.edu |
| To | Léa Gris <lea.gris@noiraude.net>, bug-bash@gnu.org |
| Envelope-to | bug-bash@gnu.org |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=case.edu; s=smtp-primary; t=1576178002; bh=/S7Kk5eay4huEQ4Dab7X+BP3jKhArAl76LjW5bZ6t6E=; h=Reply-To:Cc:Subject:To:References:From:Message-ID:Date: MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=1vOn538Pr5By//1Hrvi7beqn6XmdbI3pyIA+GrIy8UDeQpUnsohVblCNXM4gJflqVH 8u8iOmSHSYdNBlo/jpIQgg/rNQkPiNH2CFu3w2znM04XDihro+66r+MbLEOG5XHcBGR 8hcdFK3Skm2lZMbPnLfUK4BVqudRgNx8yLPbTwl9g2yYf3F5SeSeFM2NjV7GOKmKFSL wNjGaIQse51H7b0CohOSsoSD2pKtOgroCpkoHm/iykJE223FF0L5IapNNy0Sd0s2QUl hRoZKQjx0F4PDU9TvTnob3Ps0vA7P7rzeQ577wBhBD9MNKMnlLncA6BHf1tJeVOx23H 21nSB0IA== |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=case.edu; s=smtp-primary; t=1576177993; bh=WjPzqnwoK9UsLM5M8+9fD7CR0DtdZsvYbyI2ZXUlCYM=; h=Reply-To:Cc:Subject:To:References:From:Message-ID:Date: MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=nrSfAR+DLNrntjKpw8V8SEySRDEm6/qVxvAIrSBmT6zt7VhrSiAlI5UqUdjbuVgqji XIB5KS4UBfATWgWii7lZqLipu+judC6RQGyaQq3AhLcx7++GEQaEBJq+LiX89dSYYSd ouBS+pEBpluknIYscE228u2e7eN+9ZEdAY4PYgfBwuyEZ6ojTN01ZNryUkG+msIDxDf gAJxn7muvhVQZFOBfqNhWYviE/YkfrlJcPy1F3mK65uR7GBv1iNtL9KgGT5wJSC0leB Obk1BlVjPc6IvEJj8CEA/Ky7QrX6AyCL3LWnzvyMZ5LqYZzGSTiYJVk3Cto6P1tOsRO pTwhwLMg== |
| User-Agent | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.3.0 |
| In-Reply-To | <c9224e23-ff7d-ba84-dc4f-aa68db902f72@noiraude.net> |
| Content-Language | en-US |
| X-Junkmail-Status | score=7/90, host=mpv2-2015.case.edu |
| X-Junkmail-PrAS-Raw | score=7/90, refid=2.7.2:2019.12.12.180017:17:7.944, ip=, rules=DKIM_SIGNATURE, __HAS_REPLYTO, __HAS_CC_HDR, __SUBJ_REPLY, __BOUNCE_CHALLENGE_SUBJ, __BOUNCE_NDR_SUBJ_EXEMPT, __SUBJ_ALPHA_END, __TO_MALFORMED_2, __TO_NAME, __TO_NAME_DIFF_FROM_ACC, __HAS_REFERENCES, __REFERENCES, __HAS_FROM, FROM_EDU_TLD, __HAS_MSGID, __SANE_MSGID, DATE_TZ_NA, __USER_AGENT, __MOZILLA_USER_AGENT, __MIME_VERSION, __IN_REP_TO, __CT, __CT_TEXT_PLAIN, __CTE, __REPLYTO_SAMEAS_FROM_ADDY, __REPLYTO_SAMEAS_FROM_ACC, __FROM_DOMAIN_IN_ANY_CC1, __FROM_DOMAIN_IN_ANY_CC2, __REPLYTO_SAMEAS_FROM_DOMAIN, __DKIM_ALIGNS_1, __DKIM_ALIGNS_2, __ANY_URI, __URI_MAILTO, __URI_WITH_PATH, __URI_NO_WWW, __CP_URI_IN_BODY, __FRAUD_MONEY_CURRENCY_DOLLAR, __SUBJ_ALPHA_NEGATE, __URI_IN_BODY, __URI_NOT_IMG, __MAIL_CHAIN, __FORWARDED_MSG, __BODY_NO_MAILTO, __NO_HTML_TAG_RAW, BODY_SIZE_600_699, BODYTEXTP_SIZE_3000_LESS, __MIME_TEXT_P1, __MIME_TEXT_ONLY, __URI_NS, [TRUNCATED], so=2010-03-03 19:42:08, dmn=2016-08-03-0138 |
| X-detected-operating-system | by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy] |
| X-Received-From | 129.22.103.227 |
| X-BeenThere | bug-bash@gnu.org |
| X-Mailman-Version | 2.1.23 |
| Precedence | list |
| List-Id | Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org> |
| List-Unsubscribe | <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe> |
| List-Archive | <https://lists.gnu.org/archive/html/bug-bash> |
| List-Post | <mailto:bug-bash@gnu.org> |
| List-Help | <mailto:bug-bash-request@gnu.org?subject=help> |
| List-Subscribe | <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe> |
| X-Mailman-Original-Message-ID | <79b6365d-4c09-7122-25c3-4564fd304948@case.edu> |
| X-Mailman-Original-References | <c9224e23-ff7d-ba84-dc4f-aa68db902f72@noiraude.net> |
| Xref | csiph.com gnu.bash.bug:15717 |
Show key headers only | View raw
On 12/12/19 12:08 PM, Léa Gris wrote:
> Hello,
>
> Depending on how an empty array is declared, it is not stored with the
> same state.
>
> # Empty array declared without parenthesis
> unset myArr
> declare -a myArr
> typeset -p myArr
> echo "${#myArr[@]}"
This is an unset variable with the array attribute; you have not assigned a
value.
> # Empty array declared without parenthesis
> unset myArr
> declare -a myArr=()
This is an empty array variable; you have assigned a value.
--
``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/
Back to gnu.bash.bug | Previous | Next — Next in thread | Find similar | Unroll thread
Re: Two states of empty arrays Chet Ramey <chet.ramey@case.edu> - 2019-12-12 14:13 -0500 Re: Two states of empty arrays Léa Gris <lea.gris@noiraude.net> - 2019-12-12 22:04 +0100 Re: Two states of empty arrays Martin Schulte <gnu@schrader-schulte.de> - 2019-12-12 22:34 +0100
csiph-web