[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    -e oneliners with File.open
From:       Tobias Reif <tobiasreif () pinkjuice ! com>
Date:       2002-05-22 13:52:25
[Download RAW message or body]

Hi,

I wanted to see how well Vim handles large files, so I entered something 
like

ruby -e 'File.open("foo.txt","w") do |f|; f.write 6; end'

(the string to write was different, but the above is enough to reproduce 
the error)
but got

-e:1: parse error

This file runs:
-----
File.open("delete.txt", "w") do |file|
   # 100 000 lines with 1 000 xs =~ 100 MB
   file.write((("x"*1000)+"\n")*100000)
end
-----

How to do it with -e in the commandline?

Tobi

-- 
http://www.pinkjuice.com/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic