bug-bash
[Top][All Lists]
Advanced

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

Re: test '-v' - associative vs. normal array discrepancy - a bug ?


From: Piotr Grzybowski
Subject: Re: test '-v' - associative vs. normal array discrepancy - a bug ?
Date: Wed, 19 Nov 2014 21:52:39 +0100

 now I wonder, maybe this:

$#a

should return number of elements in array, if a is an array, and
strlen($a) for scalars?

cheers,
pg






On Wed, Nov 19, 2014 at 9:47 PM, Greg Wooledge <address@hidden> wrote:
> On Wed, Nov 19, 2014 at 02:41:13PM -0600, Eduardo A. Bustamante López wrote:
>> People, are we forgetting that this is supposed to work in a function, by
>> passing the name of a variable?
>
> Passing the name of a variable has NEVER worked in ANY function for ANY
> purpose in bash.  It only works in ksh93, which has proper namerefs.
> Every time you try to do it in bash, you introduce a security hole, or
> you ride the eval bus to hell.
>
> This is precisely why I tell people not to try to write "libraries" of
> reusable code in bash.  You just can't do it.  It's pointless to try.
>



reply via email to

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