bash: array - Add elements to an array.



  • Take into account the main readme for this section. README first.

    An array called planet.

    $ declare -a planet=(earth wind fire)
    

    Add water to element planet.

    $ planet=("${planet[@]}" water)
    $ echo "${planet[@]}"
    earth wind fire water
    

Log in to reply
 

© Lightnetics 2024