B
bwv549
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
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