#!/usr/bin/awk -f # There are no scopes, so we just write to `arr` here and use it later. # Returning the array does not seem to be legal either. Only scalars allowed. function prepareInput(raw) { len = split(raw, arr, ","); for (i=0; i<=len; i++) { arr[i-1] = int(arr[i]); } return len; } function process(arr, len, first, second) { arr[1] = first arr[2] = second for (i=0; i