Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 01-18-2007, 08:00 PM   #1
Registered: Dec 2003
Location: Maryland
Distribution: Fedora, Ubuntu, Centos, FreeBSD
Posts: 390

Rep: Reputation: 31
[Ruby] Tar'ing or Zip'ing with ruby script

Is there anyway to pass shell commands through ruby script?

I want to be able to tar or zip files but don't want to have to create a separate script to do this and then have ruby finish the rest of the job.

Is there a way that I can insert a tar or zip command inside of my ruby script?
Old 01-19-2007, 06:29 PM   #2
Registered: Jun 2005
Location: Indiana, USA
Distribution: OpenBSD, Ubuntu
Posts: 892

Rep: Reputation: 43
Hi, sorry this is somewhat late.

The Zlib module (part of the standard library) has support for zip and gzip handling of files:

Also, the Kernel module has a method "system(cmd, [args]*)" that executes a command in a subshell:

Edit: Yay! This is my (expt 2 9)th post!

Last edited by taylor_venable; 01-19-2007 at 06:32 PM.
Old 01-19-2007, 06:56 PM   #3
Registered: Dec 2003
Location: Maryland
Distribution: Fedora, Ubuntu, Centos, FreeBSD
Posts: 390

Original Poster
Rep: Reputation: 31
Thanks for the reply, I will give it a shot...


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Subversion ruby script fails fenrisW0lf *BSD 1 12-21-2007 06:57 PM
need help with a ruby script listing directory contents Joseph Schiller Programming 4 12-31-2006 11:46 PM
cleaning the readability of this ruby script hedpe Programming 1 12-26-2006 02:46 PM
learn c++ before ruby? hottdogg Programming 13 06-17-2005 06:47 PM
Ruby help and advice Geeky_Kid Programming 5 12-31-2003 03:28 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:37 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration