how to add elements to bash array code example
Example: how to append an array in bash
#!/bin/bash
#Making an array
array=(1 2 3)
#Appending the array
array+=(4)
#Printing the array
echo ${array[@}
# output: 1 2 3 4
#!/bin/bash
#Making an array
array=(1 2 3)
#Appending the array
array+=(4)
#Printing the array
echo ${array[@}
# output: 1 2 3 4