[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Add support for array .pop()
From: |
lolilolicon |
Subject: |
Re: Add support for array .pop() |
Date: |
Sat, 15 Oct 2016 17:47:22 +0800 |
On Sat, Oct 15, 2016 at 5:41 PM, lolilolicon <lolilolicon@gmail.com> wrote:
>
> pop() {
> local -n _a=$1
> printf -v "$2" "${_a[-1]}"
and of course I meant
printf -v "$2" '%s' "${_a[-1]}"
The keyword is nameref if you haven't heard of it, so you can look it
up in the man page :)
Re: Add support for array .pop(), Chet Ramey, 2016/10/15