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: Dan Douglas
Subject: Re: [Help-bash] opposite of 'shift'
Date: Thu, 16 Feb 2012 08:26:59 -0600
User-agent: KMail/4.7.4 (Linux/3.1.6-pf; KDE/4.7.4; x86_64; ; )

On Thursday, February 16, 2012 08:57:47 AM Greg Wooledge wrote:
> On Thu, Feb 16, 2012 at 07:44:47AM -0600, Peng Yu wrote:
> > I recall now that I have seen this before. I think that it is probably
> > better to have some function like 'unshift' [...]
> 
> You can implement an unshift function for your scripts if you want.
You can't. nonlocal positional parameters are inacceessable. I'd actually like 
to see a "shiftpop" that returns the value or maybe does an assignment, 
because 99% of the time that's what happens immediately before a shift.

But you were right the first time, there's no reason not to use an array. (well 
i can think of a few corner cases as usual, but... nobody cares)
-- 
Dan Douglas

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

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