This topic is about AWK – Array Membership Operator.
It is represented by in. It is used while accessing array elements. The following example prints array elements using this operator.
Example
[jerry]$ awk 'BEGIN { arr[0] = 1; arr[1] = 2; arr[2] = 3; for (i in arr) printf "arr[%d] = %d\n", i, arr[i] }'
On executing this code, you get the following result −
Output
arr[0] = 1 arr[1] = 2 arr[2] = 3
In this topic we learned about AWK – Array Membership Operator. To know more, Click Here.
Pingback: AWK - Operators - Adglob Infosystem Pvt Ltd
Pingback: AWK - String Concatenation Operator - Adglob Infosystem Pvt Ltd