help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] array issue


From: lxnf98mm
Subject: Re: [Help-bash] array issue
Date: Tue, 21 Feb 2012 08:06:36 -0600 (CST)
User-agent: Alpine 2.00 (LRH 1167 2008-08-23)

On Sun, 19 Feb 2012, Bill Gradwohl wrote:

On Sun, Feb 19, 2012 at 9:30 AM, Bill Gradwohl <address@hidden> wrote:

I'm stumped. Can anyone please explain this:

declare -a regex
echo highest subscript of regex=${#regex}
   regex[${#regex}]='[_a-zA-Z0-9][[:alnum:]]*[[:blank:]]*()'
echo highest subscript of regex=${#regex}

Produces:
address@hidden junk# ./test
highest subscript of regex=0
highest subscript of regex=38


Never mind - I discovered my mistake.
Should be using address@hidden



I have used $((address@hidden - 1)) to get the highest subscript
Is there a better/easier way

Richard



reply via email to

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