From: Morton Goldberg Date: 2006-08-10T09:23:21+09:00 Subject: Re: access built-in shell commands like 'history' or 'fc' Why not access them by reading the file ~/.bash-history? Regards, Morton 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. > > Thanks > >