#!/usr/bin/env ruby begin template = File.open(ARGV[0], "r").read amount = ARGV[1].to_i puts "# Autogenerated with stresser-loggen #{ARGV.join(' ')}\n\n" amount.times do |i| puts template.gsub '{{n}}', i.to_s end rescue Exception => e puts "ERROR:" puts e puts "~"*80 puts "Usage (e.g. to generate 15 sessions): stresser-loggen some.log.tpl 15 > some.log" end