From: Terry Poulin Date: 2007-09-11T13:17:54+09:00 Subject: Re: Run UNIX command Since the question has been answered, I'd like to pipe in my own two cents. Remember what you pass to system() will not work as expected if the system running it does not have it. For example, if you use an option specific to a GNU Program that is not supported by a given POSIX system, it won't work right. If you use system( 'gedit' ) and the user does not have gedit in their path, well joy for your program and users. Ruby has a large standard library that can do much of what the basic UNIX and DOS commands can do. You should really take a look at FileUtils or ftools in ri before you decide to do some thing that will only work on a specific system family (e.g. GNU, BSD, POSIX, DOS). Other wise, why bother with a language that provides such things out of the box... It'll just create more work later if you ever want to use your Program on say, an OS/2 or Windows machine. system() is better for things that are just wasteful to write yourself or to much bother to do yourself in my humble opinion. An example of using command specific to GNU's tar program with the tar implementation on my OpenBSD system. Terry@vectra-$ touch foo bar Terry@vectra-$ tar -cf test1.tar foo bar Terry@vectra-$ ls bar foo test1.tar Terry@vectra-$ tar --create --file=test2.tar foo bar tar: unknown option -- - usage: tar {crtux}[014578befHhLmOoPpqsvwXZz] [blocking-factor | archive | replstr] [-C directory] [-I file] [file ...] tar {-crtux} [-014578eHhLmOoPpqvwXZz] [-b blocking-factor] [-C directory] [-f archive] [-I file] [-s replstr] [file ...] TerryP. -- http://en.wikipedia.org/wiki/FORTRAN#FORTRAN_quotations Note the listing about 'pi' ^_^ -- Email and shopping with the feelgood factor! 55% of income to good causes. http://www.ippimail.com