[Top][All Lists]
[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
signature.asc
Description: This is a digitally signed message part.
- Re: [Help-bash] opposite of 'shift', (continued)
- Re: [Help-bash] opposite of 'shift', Chet Ramey, 2012/02/16
- Re: [Help-bash] opposite of 'shift', Eric Blake, 2012/02/16
- Re: [Help-bash] opposite of 'shift', Peng Yu, 2012/02/16
- Re: [Help-bash] opposite of 'shift', Greg Wooledge, 2012/02/17
- Re: [Help-bash] opposite of 'shift', Davide Brini, 2012/02/16
- Re: [Help-bash] opposite of 'shift', Clark J. Wang, 2012/02/16
- Re: [Help-bash] opposite of 'shift',
Dan Douglas <=
- Re: [Help-bash] opposite of 'shift', Greg Wooledge, 2012/02/16
- Re: [Help-bash] opposite of 'shift', Dan Douglas, 2012/02/16
- Re: [Help-bash] opposite of 'shift', Chet Ramey, 2012/02/16
- Re: [Help-bash] opposite of 'shift', Dan Douglas, 2012/02/16
- Re: [Help-bash] opposite of 'shift', Pierre Gaston, 2012/02/17
- Re: [Help-bash] opposite of 'shift', Steven W. Orr, 2012/02/17
- Re: [Help-bash] opposite of 'shift', Chet Ramey, 2012/02/18