On Jun 27, 7:33 pm, Frank Church <vfcfor... / gmail.com> wrote:
> f = File.new(configfile, File::CREAT|File::WRONLY, 0700)
> header_commands.each {|x| f.puts x }
> mysql_commands.each {|x| f.puts x }
> dir_commands.each {|x| f.puts x }
> scp_commands.each {|x| f.puts x }

File.new( configfile, File::CREAT|File::WRONLY, 0700){ |f|
  f.puts [ header_commands, mysql_commands, dir_commands,
scp_commands ].flatten
}

(Since puts will already join the array with \n)