declare -a arr=(a b c)

Category: Shell & Bash

declare -a arr=(a b c)

Declare an indexed array

Creates an indexed array (like a list). Access elements with ${arr[0]}, ${arr[1]}, etc.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.