about Grigoris Maravelias
External variable inside awk

External variable inside awk

Sometimes, a variable may be needed to get inside awk (for or while loop for example). In order to pass the variable inside awk, include it like:
awk -v i=$i '{ .. }' test

Leave a Reply

Your email address will not be published. Required fields are marked *