Name

for

Synopsis

for( item in array )

     command

Description

For each item in an associative array, do command. Multiple commands must be put inside braces. Refer to each element of the array as array [ item ]. Elements of gawk arrays are stored in an order that enables access of any element in essentially equivalent time. This order may appear to be indiscriminate; if the output is desired in sorted order, you must pipe it through the sort command.

Get Linux in a Nutshell, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.