• Awk Array Loop translation

    While working on a HP UX storage migration project, I found an awk statement as following

    ioscan -funNCdisk | \
    awk '{a[NR]=$0} $0~s {f[NR]++} END {for (j=1;j<=NR;j++) if (f[j]) for (i=j+C;i<=j+C;i++) \
    print a[i]}' C=1 s="NetApp"…