On Nov 19, 2009, at 4:41 PM, Unix4Linux Unix4Linux wrote:

> I also forgot to ask, in SHELL, when I run shell scripts, I can see  
> what
> the script is doing.  I am not referring to debug mode but more the
> output of each command being executed.
>
> Is this possible with Ruby?
>
> For example, in shell, if I had a command `yum -y install  
> package_name`,
> I am able to see all of the required packages being installed...pretty
> much, I can see the process of it all.

When you use backticks, the output is captured by ruby and is the  
return value of the backtick operator.  If you don't want to capture  
the output in your program and just want the command's output to go to  
standard out then use the
system method.

yum_output = `yum -y install package_name`

system "yum -y install package_name"

Gary Wright