[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: is there a way to assign indexed arrays like the new assoc arrays wa
From: |
Greg Wooledge |
Subject: |
Re: is there a way to assign indexed arrays like the new assoc arrays way without [..]= typing ? |
Date: |
Sat, 13 Mar 2021 09:33:50 -0500 |
On Fri, Mar 12, 2021 at 11:11:05PM +0100, Alex fxmbsw7 Ratchev wrote:
> btw i thought i must declare >> -a << the array ? hm :)
Nope. If you simply assign using array syntax, bash automatically
creates an array.
unset foo
foo=(a b c)
declare -p foo
The only time you must declare anything is when you're creating an
associative array. And because declaring a variable makes it local
to a function, the -g option was added so that you can create global
associative arrays while inside a function.
- is there a way to assign indexed arrays like the new assoc arrays way without [..]= typing ?, Alex fxmbsw7 Ratchev, 2021/03/12
- Re: is there a way to assign indexed arrays like the new assoc arrays way without [..]= typing ?, Lawrence Velázquez, 2021/03/12
- Re: is there a way to assign indexed arrays like the new assoc arrays way without [..]= typing ?, Alex fxmbsw7 Ratchev, 2021/03/12
- Re: is there a way to assign indexed arrays like the new assoc arrays way without [..]= typing ?, Lawrence Velázquez, 2021/03/12
- Re: is there a way to assign indexed arrays like the new assoc arrays way without [..]= typing ?, Alex fxmbsw7 Ratchev, 2021/03/12
- Re: is there a way to assign indexed arrays like the new assoc arrays way without [..]= typing ?, Eli Schwartz, 2021/03/12
- Re: is there a way to assign indexed arrays like the new assoc arrays way without [..]= typing ?, Alex fxmbsw7 Ratchev, 2021/03/12
- Re: is there a way to assign indexed arrays like the new assoc arrays way without [..]= typing ?, Alex fxmbsw7 Ratchev, 2021/03/12
- Re: is there a way to assign indexed arrays like the new assoc arrays way without [..]= typing ?,
Greg Wooledge <=
- Re: is there a way to assign indexed arrays like the new assoc arrays way without [..]= typing ?, Alex fxmbsw7 Ratchev, 2021/03/13