bash push to new 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