help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] opposite of 'shift'


From: Chet Ramey
Subject: Re: [Help-bash] opposite of 'shift'
Date: Thu, 16 Feb 2012 18:59:14 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:8.0) Gecko/20111105 Thunderbird/8.0

On 2/16/12 3:56 PM, Dan Douglas wrote:
> On Thursday, February 16, 2012 09:35:28 AM Greg Wooledge wrote:
>> On Thu, Feb 16, 2012 at 08:26:59AM -0600, Dan Douglas wrote:
>>> You can't. nonlocal positional parameters are inacceessable.
>> parameters.  (I gave two example input arrays.)  Sorry for the confusion.
> 
> Ah, misinterpreted.
> 
> But for arrays, it's almost worse! One of the few possible implementations... 
> It's completely incomprehensible, won't work on sparse arrays, and can only 
> return arrays directly to the scope of the caller (or global).

I wonder why you didn't take advantage of the address@hidden expansion,
which would have given you the the list of indices.  That may have
allowed you to handle sparse arrays, at the cost of using an iterator.
Of course, you did say it was one possible implementation.


-- 
``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]