From: Justin Collins Date: 2006-08-10T04:35:58+09:00 Subject: Re: access built-in shell commands like 'history' or 'fc' 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. > > Thanks Could it be that Ruby is using a different shell than you are used to? I think it uses /bin/sh by default (not sure). -Justin