|
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=38Never 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
[Prev in Thread] | Current Thread | [Next in Thread] |