Terms of Service Privacy Policy Contact Us

leistware.com

Arrays

Declaring


Arrays in Bash can be declared in a few different ways:

Syntax Description
declare -a array Use this syntax to declare an index array for the first time. This syntax will nor reinitialize an array.
declare -A array Use this syntax to declare an associative array for the first time. The only way to create this type of array.
array=() This syntax will declare an initial array and redeclare (reinitialize) an existing array.
array[0]= value Sets the first index of an array to value but if the array does not exist it will be created.

CREATED 2019-03-15 01:04:05.0

007-00-00-CE

UPDATED 2019-03-15 01:04:35.0

Knowledge

Bash Hackers Wiki

Page Server: Ithica

DBID: db.wam

©2012 Leistware Data Systems

      Hello anonymous