Languages
[Edit]
EN

Bash - get all array elements

0 points
Created by:
marc_so
894

This article will show you how to get all array elements in Bash.

 

Quick solution:

#!/bin/bash

my_array=(1 two 3 4 five 6)
echo ${my_array[@]}

Example output:

1 two 3 4 five 6

Note: 

${my_array[@]} is an alternative notation to ${my_array[*]}.

Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Bash

Bash - get all array elements
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join