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 <wool...@eeg.ccf.org> 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. >