Executing a shell command from within a ruby script?

Hello,

I am fairly new to ruby and I like to have a script that can Executing a
shell command from within a ruby script like “gem list --local”
How would I do that?

Thanks,
Bernd

On May 26, 2006, at 5:32 PM, Paatsch, Bernd wrote:

Hello,

I am fairly new to ruby and I like to have a script that can
Executing a
shell command from within a ruby script like “gem list --local”
How would I do that?

Check out the system method, and back ticks (x = gem list --local).
If you need somethin more complicated, look into IO.popen.