Question
How to assign multiple items to an array ?

We can create indexed arrays with a more concise syntax, by simply assign them some values:

$my_array=(foo bar) In this case we assigned multiple items at once to the array Question How to assign multiple items to an array ? Answer ? Question How to assign multiple items to an array ? Answer We can create indexed arrays with a more concise syntax, by simply assign them some values: $ my_array=(foo bar)

In this case we assigned multiple items at once to the array

If you want to change selection, open document below and click on "Move attachment"

How to use arrays in bash script - LinuxConfig.org
ercase -a we must use the -A option of the declare command: $declare -A my_array This, as already said, it's the only way to create associative arrays in bash. Create indexed arrays on the fly <span>We can create indexed arrays with a more concise syntax, by simply assign them some values:$ my_array=(foo bar) In this case we assigned multiple items at once to the array, but we can also insert one value at a time, specifying its index: \$ my_array[0]=foo Array operations Once an array is created, we can perform some useful operations on it, like display

#### Summary

status measured difficulty not learned 37% [default] 0

No repetitions