[Top][All Lists]

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

Documentation for declare/typeset does not address +=

From: Clint Hepner
Subject: Documentation for declare/typeset does not address +=
Date: Mon, 24 Feb 2014 11:29:12 -0500

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: darwin13.0.0
Compiler: clang
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386'
-DCONF_OSTYPE='darwin13.0.0' -DCONF_MACHTYPE='i386-apple-darwin13.0.0'
-DLOCALEDIR='/usr/local/Cellar/bash/4.2.45/share/locale' -DPACKAGE='bash'
-DSHELL -DHAVE_CONFIG_H -DMACOSX   -I.  -I. -I./include -I./lib
-I./lib/intl -I/private/tmp/bash-4vKN/bash-4.2/lib/intl  -DSSH_SOURCE_BASHRC
uname output: Darwin patikoija.local 13.0.0 Darwin Kernel Version 13.0.0:
Thu Sep 19 22:22:27 PDT 2013; root:xnu-2422.1.72~6/RELEASE_X86_64 x86_64
Machine Type: i386-apple-darwin13.0.0

Bash Version: 4.2
Patch Level: 45
Release Status: release

       The following code appears to work as expected:

       array=(a b c)
       declare "$a+=(d)
       # array is now (a b c d)

       I assume this is intentional and in keeping with how += works, but
the entry for
       declare/typeset in the man page only addresses the case where the
variable name
       is followed by =value.

        Mention += in the entry for declare/typeset, or otherwise clarify
how the builtin works.

reply via email to

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