Error:

Create array

# Three elements
array=( One Two Three )
# Two elements
array=( "One Two" Three )
# All tar.gz files in current directory
archives=( *.tar.gz )
# Two elements at indexes 5 and 6
array[5]=Five; array[6]=Six

Create associative array

declare -A dict=( ["name"]=Alex ["nick"]=gonzo )

Append array

# Add all zip archives in current directory to $archives
archives+=( *.zip )

Read array from stdin separated by whitespaces

# For input line 'One     Two Three' array would be (One, Two, Three)
read -ra array

Split string into array

IFS=, read -ra array <<< "One,Two,Three"

Access array

# First element
${array[0]}

# Associative array
${person[name]}

Join array using string

array=( One Two Three )
# str is "One,Two,Three
str=$(IFS=,; echo "${array[*]}")

Iterate over all keys of the array

for key in "${!person[@]}"; do echo "$key is ${person[$key]}"; done

Iterate over all elements of the array

array=( One Two Three )
for el in "${array[@]}"; do
    echo "$el"
done

Read lines from the file into array

n=0
while read line; do
    lines[n++]=$line 
done < file.txt