• mech@feddit.org
    link
    fedilink
    arrow-up
    1
    ·
    18 hours ago

    Them: Read The Fucking Manual!

    The Manual
                         The unset builtin treats attempts to unset array
                         subscripts @ and * differently depending on whether
                         the array is indexed or associative, and differently
                         than in previous versions.
                  •      Arithmetic commands ( ((...)) ) and the expressions
                         in an arithmetic for statement can be expanded more
                         than once.
                  •      Expressions used as arguments to arithmetic
                         operators in the [[ conditional command can be
                         expanded more than once.
                  •      The expressions in substring parameter brace
                         expansion can be expanded more than once.
                  •      The expressions in the $((...)) word expansion can
                         be expanded more than once.
                  •      Arithmetic expressions used as indexed array
                         subscripts can be expanded more than once.
                  •      test -v, when given an argument of A[@], where A is
                         an existing associative array, will return true if
                         the array has any set elements.  Bash-5.2 will look
                         for and report on a key named @.
                  •      The ${parameter[:]=value} word expansion will return
                         value, before any variable-specific transformations
                         have been performed (e.g., converting to lowercase).
                         Bash-5.2 will return the final value assigned to the
                         variable.
                  •      Parsing command substitutions will behave as if
                         extended globbing (see the description of the shopt
                         builtin above) is enabled, so that parsing a command
                         substitution containing an extglob pattern (say, as
                         part of a shell function) will not fail.  This
                         assumes the intent is to enable extglob before the
                         command is executed and word expansions are
                         performed.  It will fail at word expansion time if
                         extglob hasn't been enabled by the time the command
                         is executed.```