help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] Taking a slice of an array


From: Chet Ramey
Subject: Re: [Help-bash] Taking a slice of an array
Date: Mon, 09 Apr 2012 19:41:09 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2

On 4/9/12 10:48 AM, Bill Gradwohl wrote:

> I suggest then that this is a weak spot in the docs.
>  Parameter Expansion
>        ${parameter:offset}
>        ${parameter:offset:length}
> If parameter is an indexed array name subscripted by @ or *, the result is
> the length members of the array beginning with ${parameter[offset]}.
> 
> This makes no distinction between @ and *, and never mentions IFS. It never
> occurred to me to try * due to the docs.

Read the section on Arrays, where array subscripting is described.

It's not a "weak spot," it's just a different spot.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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