[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: unset -v cant unset outside function ?
From: |
Andreas Kusalananda Kähäri |
Subject: |
Re: unset -v cant unset outside function ? |
Date: |
Mon, 20 Feb 2023 10:42:56 +0100 |
On Mon, Feb 20, 2023 at 09:52:29AM +0100, alex xmb ratchev wrote:
> unset -v a ; a=( 0 1 ) ; f() { declare -ga a ; unset -v a ; a+=( 3 ) ; } ;
> declare -p a
> declare -a a=([0]="0" [1]="1")
>
> unset -v a ; a=( 0 1 ) ; f() { unset -v a ; a+=( 3 ) ; } ; declare -p a
> declare -a a=([0]="0" [1]="1")
Don't forget to actually call your function.
--
Andreas (Kusalananda) Kähäri
SciLifeLab, NBIS, ICM
Uppsala University, Sweden
.