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
  • 7

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
  • 7,325
  • 6
  • 37
  • 63