P
Philip W.
Hello all,
I'm writing a Ruby shell for Ubuntu Linux 7.04. I would like my
shell to take commands from the user, run the command, output the result
to the command line, and log the result in a file. But I am having
trouble getting the Ruby shell to output the result to the command line,
and log the command. I've tried everything I can think of - using the
backticks method (``), exec(), system(), and IO.popen, strange
combinations of the mentioned and eval(), but nothing satisfies both of
my requirements. Sometimes the shell will output the command result to
the shell, but it won't log it. Sometimes it will log the command
result, but it won't output it to the shell. Sometimes it does one or
both things, but it only outputs or logs some of the command result. I
would appreciate any help that I could get on ways to make this work.
Thanks,
Philip W.
I'm writing a Ruby shell for Ubuntu Linux 7.04. I would like my
shell to take commands from the user, run the command, output the result
to the command line, and log the result in a file. But I am having
trouble getting the Ruby shell to output the result to the command line,
and log the command. I've tried everything I can think of - using the
backticks method (``), exec(), system(), and IO.popen, strange
combinations of the mentioned and eval(), but nothing satisfies both of
my requirements. Sometimes the shell will output the command result to
the shell, but it won't log it. Sometimes it will log the command
result, but it won't output it to the shell. Sometimes it does one or
both things, but it only outputs or logs some of the command result. I
would appreciate any help that I could get on ways to make this work.
Thanks,
Philip W.