Tell me, please, why awk does not transmit an external variable to the template. Sample script:
#/bin/sh PROTO="tcp" LINES=(`sudo /sbin/iptables --numeric --line-numbers --list INPUT | awk -v prt=$PROTO '/prt/ {print $1}'`) echo ${LINES[@]} Conclusion: an empty array.