1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#!/usr/bin/awk -f /^http {/ { config_file = "/opt/anki-sync-server/plugins/nginx/config" print while (getline nextLine && nextLine !~ "^}$") { print nextLine } while ((getline config < config_file)){ print "\t" config } close(config) print "}" next }; {print}