Hi,
I have following script. It works fine except that “system” command
does not read output file “tmp_out.txt”, when I run the script. I do not
get any error when I run the script. I expect to see the results of
system “sort tmp_out.txt” on my Terminal window, but do not see it. Do
you guys have any idea what I am doing wrong.
Thank you very much.
#!/Users/yigit/.rvm/rubies/ruby-1.9.2-p290/bin/ruby -w
file_out = File.new(“tmp_out.txt”, “w”) #makes new file for writing
while (DATA.gets) do
line = $_
(chr, start, stop) = line.split("\t")
for i in (Integer(start)…Integer(stop))
file_out.puts i
end
end
system “sort tmp_out.txt”
END
chr 1 4
chr 3 6
chr 5 8