Feature Group
bash internal (293)
250
bash
This demonstrates various operations on an array in Bash, including accessing elements, counting elements, slicing, and listing indices.
echo "${Fruits[0]}" # Element #0 echo "${Fruits[-1]}" # Last element echo "${Fruits[@]}" # All elements, space-separated echo "${#Fruits[@]}" # Number of elements echo "${#Fruits}" # String length of the 1st element echo "${#Fruits[3]}" # String length of the Nth element echo "${Fruits[@]:3:2}" # Range (from position 3, length 2) echo "${!Fruits[@]}" # Keys of all elements, space-separated
bash internaldata manipulationsarray manipulationsarray operations