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 th code below have as output ?

$ for i in "${my_array[@]}"; do echo "$i"; done

Answer

foo

bar


Question

What does th code below have as output ?

$ for i in "${my_array[@]}"; do echo "$i"; done

Answer
?

Question

What does th code below have as output ?

$ for i in "${my_array[@]}"; do echo "$i"; done

Answer

foo

bar

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

How to use arrays in bash script - LinuxConfig.org
clear when performing a for loop. As an example, imagine we have an array with two elements, "foo" and "bar": $ my_array=(foo bar) Performing a for loop on it will produce the following result: <span>$ for i in "${my_array[@]}"; do echo "$i"; done foo bar When using *, and the variable is quoted, instead, a single "result" will be produced, containing all the elements of the array: $ for i in "${my_array[*]}"; do echo "$i"; done

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.