Is the following difference intentional, a bug, or do I miss something?
unset a
set -- "[EMAIL PROTECTED]"
echo $#
Output: 0
typeset a
set -- "[EMAIL PROTECTED]"
echo $#
Output: 1
The man page says, "If the word is double-quoted, ... [EMAIL PROTECTED] expands
each element of name
Configuration Information [Automatically generated, do not change]:
Machine: i486
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i486'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu'
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='ba
Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i386'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-redhat-linux-gnu'
-DCONF_VENDOR='redhat' -DLOCALEDIR='/usr/share/locale'
-DPACKA
[EMAIL PROTECTED] wrote:
> Bash Version: 3.2
> Patch Level: 39
> Release Status: release
>
> Description:
> When nullglob option is enable (shopt -s nullglob), unset of an array
> does not work.
You're right; it does. `unset' is a builtin, so all of the shell's word
expansions are p
Björn Augustsson wrote:
> Bash Version: 3.2
> Patch Level: 33
> Release Status: release
>
> Description:
>
> The test case below is pretty self-explanatory.
> The assignment in fun_bad() doesn't exit the shell,
> despite the "set -e".
>
> This is the version in F
Bernd Eggink wrote:
> Is the following difference intentional, a bug, or do I miss something?
>
> unset a
> set -- "[EMAIL PROTECTED]"
> echo $#
>
> Output: 0
This is correct.
> typeset a
> set -- "[EMAIL PROTECTED]"
> echo $#
>
> Output: 1
The question is how to treat the variabl
Chet Ramey wrote:
> Björn Augustsson wrote:
> > fun_bad() { local bah=$( false ); }
> > fun_good() { local bah ; bah=$( false ); }
>
> The `local' command returns success if the variable assignment succeeds,
> which it does. The command substitution doesn't affect its exit status.
> This is how al