bash: for ... do iteration
This is a wiki page. Be bold and improve it!
If you have any questions about the content on this page, don't hesitate to open a new ticket and we'll do our best to assist you.
Iterate over an array:
#!/bin/bash
for element in "${my_array[@]}"
do
echo "${element}"
done
See also
Issues related to this page:
Project | Summary | Status | Priority | Category | Last updated | Assigned to |
---|---|---|---|---|---|---|
Programming | Bash: iterate over bash array in the order the … | active | normal | support request | 8 years 42 weeks |