Loops and Lists
Arrays
Multiple Values
Bash arrays store several words under one variable name. Indexes start at zero.
Program
Play the script to watch an array provide one element and a count.
arrays.sh
#!/usr/bin/env bash
tasks=("lint" "test" "package")
first="${tasks[0]}"
count="${#tasks[@]}"
echo "$first/$count"
array
An array stores multiple values and retrieves each by index.
array length
`${#array[@]}` expands to the number of array elements.