#!/usr/bin/ruby if ARGV.size < 1 then puts "Usage: #{__FILE__} times [log_no or file_name]" exit end log_file = '../../080806_watarase/analysis/bj_IO_276815.csv' log_no_or_name = ARGV[1] if log_no_or_name =~ /\d+/ then case $&.to_i when 0 log_file = '../../080806_watarase/analysis/bj_IO_276887.csv' when 1 log_file = '../../080806_watarase/analysis/bj_IO_276815.csv' end elsif log_no_or_name then log_file = log_no_or_name end begin command =<<-__TEXT__ ./build_VC9/longitudinal.exe \ #{log_file} 0 \ 2>/dev/null > ../CVS_IGNORE/flight_log_true.csv __TEXT__ puts command.chop! `#{command}` end ARGV[0].to_i.times{|i| command =<<-__TEXT__ ./build_VC9/longitudinal.exe \ #{log_file} \ 2>/dev/null > ../CVS_IGNORE/flight_log_#{sprintf("%03d", i)}.csv __TEXT__ puts command.chop! `#{command}` }