array

Fruits=('Apple' 'Banana' 'Orange' 'Pear')

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

Fruits=("${Fruits[@]}" "Grape")          # Push
Fruits+=('Watermelon')                   # Also Push
Fruits=( ${Fruits[@]/Ap*/} )             # Remove by regex match
unset Fruits[2]                          # Remove one item
Fruits=("${Fruits[@]}")                  # Duplicate
Fruits=("${Fruits[@]}" "${Veggies[@]}")  # Concatenate

TempFiles=($(ls /tmp))

for i in "${Fruits[@]}"; do
  echo $i
done

if [[ " ${Fruits[*]} " =~ " Banana " ]]; then
  echo "Apple in Fruits"
fi
