From: ara.t.howard@... Date: 2006-08-10T09:29:03+09:00 Subject: Re: access built-in shell commands like 'history' or 'fc' On Thu, 10 Aug 2006, Morton Goldberg wrote: > On Aug 9, 2006, at 3:30 PM, bwv549 wrote: > >> How do I access built-in shell commands (like 'history' or 'fc') with a >> system call? >> >> Not what I was expecting: >> % ruby -e 'puts `history`' >> -e:1: command not found: history >> >> But this works fine: >> >> % ruby -e 'puts `pwd`' >> /home/john >> >> I've tried this: >> >> % ruby -e 'system "history >tmp.tmp"; puts IO.read("tmp.tmp")' >> >> And no errors are generated, but there is nothing in tmp.tmp, either. that's because each call starts a __new__ shell so you won't have any history! see my post about session. -a -- to foster inner awareness, introspection, and reasoning is more efficient than meditation and prayer. - h.h. the 14th dali lama