From: Tim Hunter Date: 2007-09-09T23:28:56+09:00 Subject: Re: Run UNIX command Pieter Jongsma wrote: > Hi, > > I'm looking for a way to execute an UNIX command from a ruby program. > For instance, when the user selected a .tar.gz file, using the untar > command to decompress it. > How can I do that? > > Thanks in advance! > pieter. > There's a variety of ways to do that, depending on your needs. The simplest is to use the Kernel.system method: system("ls") If you need the stdout output from the command, use backticks: output = `ls` If you need more control, check out IO.popen. -- RMagick OS X Installer [http://rubyforge.org/projects/rmagick/] RMagick Hints & Tips [http://rubyforge.org/forum/forum.php?forum_id=1618] RMagick Installation FAQ [http://rmagick.rubyforge.org/install-faq.html]