From: XueBrian Date: 2012-07-14T02:01:41+09:00 Subject: How to save an irb session including the command output to a file --_e94e1c61-98d7-4f17-800f-110a11f0536a_ Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: 8bit Hi, I noticed from google there are many methods to save irb command history to a file, but is there a method to save both the command history and command output to a file when exiting irb? For example, the red lines should also be saved. irb(main):001:0> class Airb(main):002:1> puts "hello world"irb(main):003:1> endhello world=> nilirb(main):004:0> I tried to use "irb | tee irb.log", but seems there will be unreadable character displayed when using "Arrow keys". Thanks,Brian --_e94e1c61-98d7-4f17-800f-110a11f0536a_ Content-Type: text/html; charset="gb2312" Content-Transfer-Encoding: 8bit
Hi,

I noticed from google there are many methods to save irb command history to a file, but is there a method to save both the command history and command output to a file when exiting irb?

For example, the red lines should also be saved.

irb(main):001:0> class A
irb(main):002:1> puts "hello world"
irb(main):003:1> end
hello world
=> nil
irb(main):004:0>


I tried to use "irb | tee irb.log", but seems there will be unreadable character displayed when using "Arrow keys".

Thanks,
Brian
--_e94e1c61-98d7-4f17-800f-110a11f0536a_--