Languages
[Edit]
EN

Bash - get all array elements

0 points
Created by:
marc_so
264

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[*]}.

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