Contents
How do I print an entire array in Linux?
Bash Script
- #!/bin/bash.
- #Script to print all the elements of the array.
- #declaring the array.
- declare -a example_array=( “Welcome””To””Javatpoint” )
- #Printing all the elements.
- echo “${example_array[@]}”
How do you print an array element in Unix?
To refer to the value of an item in array, use braces “{}”. The braces are required to avoid issues with pathname expansion. To write all elements of the array use the symbol “@” or “*”.