Answers for "bash adding to array"

4

bash adding to array

#!/bin/bash

#Making an array
array=(1 2 3)

#Appending the array
array+=(4)

#Printing the array
echo ${array[@]}
Posted by: Guest on February-24-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language