Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.



Question

What does the code below do ?

$ my_array=(foo bar)

$ my_array+=(baz)

Answer
It appends baz into the array (foo bar). The result is (foo bar baz)

Question

What does the code below do ?

$ my_array=(foo bar)

$ my_array+=(baz)

Answer
?

Question

What does the code below do ?

$ my_array=(foo bar)

$ my_array+=(baz)

Answer
It appends baz into the array (foo bar). The result is (foo bar baz)
If you want to change selection, open document below and click on "Move attachment"

How to use arrays in bash script - LinuxConfig.org
e array by specifying respectively their index or associative key. In the case of indexed arrays, we can also simply add an element, by appending to the end of the array, using the += operator: <span>$ my_array=(foo bar) $ my_array+=(baz) If we now print the content of the array we see that the element has been added successfully: $ echo "${my_array[@]}" foo bar baz Multiple elements can be added at a time: $ my_array=(f

Summary

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Details

No repetitions


Discussion

Do you want to join discussion? Click here to log in or create user.