bash_arrays
If you want to send us your comments, please do so. Thanks
More on comments
Bash Array
Declare
Indexed array: declare -a somearray
Associative array: declare -A somearray
somearray[0]=variablething | |
echo ${somearray[0]} | The value of variablething is displayed |
echo ${somearray[@]} | All the values in array somearray are displayed |
echo ${#somearray[@]} | The number of elements in the array |
echo “${!somearray[@]}“ | The syntax “${!somearray[@]}” (notice the !) gets expanded into a list of array keys, not values |
Useful links
Bash Guide on Arrays
Bash Cheat sheet on Arrays
Main subjects on this wiki: Linux, Debian, HTML, Microcontrollers, Privacy
RSS
Disclaimer
Privacy statement
Bugs statement
Cookies
Copyright © : 2014 - 2024 Webevaluation.nl and the authors
Changes reserved.
bash_arrays.txt · Last modified: 24-03-2021 11:05 by wim