#!/usr/bin/awk -f BEGIN { print "\n----Copy after this line---Copy after this line---Copy after this line----\n\n$i++;\n$config['Servers'][$i]['host'] = '__serverip__'; // hostname to monitor\n$config['Servers'][$i]['server_name'] = '__servername__';" } 1 { print "$config['Servers'][$i]['service']["NR"] = '"$1"';" } END { print "\n--------------------------------------------------------------------------"}