[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Negative array subscript with unset
From: |
Dennis Williamson |
Subject: |
Re: Negative array subscript with unset |
Date: |
Sat, 12 Mar 2011 18:48:01 -0600 |
On Sat, Mar 12, 2011 at 6:21 PM, Chris F.A. Johnson
<chris@cfajohnson.com> wrote:
>
> I all versions I have tried, unsetting an array element using a
> negative index fails:
>
> $ array=( q w e r t y )
> $ unset 'array[-1]'
> bash: [-1]: bad array subscript
>
>
> --
> Chris F.A. Johnson, <http://cfajohnson.com/>
> Author:
> Pro Bash Programming: Scripting the GNU/Linux Shell (2009, Apress)
> Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
>
>
Assignments to negative indices don't work either. (Bash 4.2)
--
Visit serverfault.com to get your system administration questions answered.