0

I am trying to concatenate arrays on Command Line Interface. example:

array1=( a b c )

However, echo $array1 prints only the first element of the array.

AishwaryaK
  • 61
  • 2
  • 11

1 Answers1

2

In order to print the complete array, you will have to get all array members:

array1=( a b c );
echo ${array1[@]}
> a b c

More information about bash arrays here.

Titulum
  • 9,928
  • 11
  • 41
  • 79