> > For me, an empty string (or empty commadline) is as set or as
> > unset as an empty array. But I don't get an "unbound error" when
> > accessing an empty string (or empty commandline), and I get one
> > when accessing an empty array.
>
> As the man page says:
>
> A parameter is set if it has
On 12/20/10 3:52 AM, jens.schmid...@arcor.de wrote:
>> -u Treat unset variables as an error when substituting.
>>
>> I think the behaviour is consistent with the documentation.
>
> The question is rather when to consider a variable set or unset.
>
> For me, an empty string (or empty commadline)
jens.schmid...@arcor.de wrote:
-u Treat unset variables as an error when substituting.
I think the behaviour is consistent with the documentation.
The question is rather when to consider a variable set or unset.
I'm not sure about the intended meaning here, but I don't consiter $@ as
a var
> -u Treat unset variables as an error when substituting.
>
> I think the behaviour is consistent with the documentation.
The question is rather when to consider a variable set or unset.
For me, an empty string (or empty commadline) is as set or as
unset as an empty array. But I don't get an "
On 12/17/10 4:48 AM, jens.schmid...@arcor.de wrote:
> Bash Version: 4.1
> Patch Level: 0
> Release Status: release
>
> Description:
>Referencing empty array with "set -u" active throws unbound variable error.
>
> Repeat-By:
> $ set -u
> $ declare -a array
> $ array=( )
> $ echo "${ar
jens.schmid...@arcor.de wrote:
For an empty "$@" this does not throw an "unbound" error, which seems to be
an inconsistent behaviour to me.
-u Treat unset variables as an error when substituting.
I think the behaviour is consistent with the documentation.
--
Be conservative in what you d
Configuration Information [Automatically generated, do not change]:
Machine: sparc
OS: solaris2.9
Compiler: /sapmnt/global/tools/compiler/SS11/SUNWspro/bin/cc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='sparc'
-DCONF_OSTYPE='solaris2.9' -DCONF_MACHTYPE='sparc-sun-solaris2.9'
-DCONF_VEN