* You can use split to create an array from a string: {{{ sh awk -v list='foo,bar,baz' ' BEGIN { n=split(list, array, /,/) # now: array[1] == "foo", array[2] == "bar", ... for (idx in array) map[array[idx]] = k } $0 in map { ... }' }}} * If you want to compare two files with awk (doesn't work if {{{file1}}} is empty). The following code snippet passes an array via {{{file1}}}: {{{ sh awk ' # cmp as awk program NR == FNR { array[NR] = $0; next } !(FNR in array && $0 == array[FNR]) { result = 1; exit } END { exit (NR != 2 * FNR || result + 0) } ' file1 file2 }}} With gawk one could use {{{ARGIND == 1}}} instead of {{{NR == FNR}}}, which is working also for an empty file {{{file1}}}. For an explanation of this technique see: ComparingTwoFiles
Summary:
This change is a minor edit.
Username: