#!/bin/bash awk '/TAG/ {tag++; sub("TAG", tag);} { print };'