Michael Guterl
10/3/2008 5:47:00 PM
On Fri, Oct 3, 2008 at 6:48 AM, Lex Williams <etaern@yahoo.com> wrote:
> pros and cons ?
>
> pro would be that you can write your own version of a binary
>
> con would be that a shell is spawned to execute the command
>
> Another way to execute a command would be through the system method. But
> then you couldn't get the command output that easily , since system
> returns an exit code .
Actually Kernel#system returns true or false
macbook:~ michaelguterl$ ri Kernel#system
---------------------------------------------------------- Kernel#system
system(cmd [, arg, ...]) => true or false
------------------------------------------------------------------------
Executes _cmd_ in a subshell, returning +true+ if the command was
found and ran successfully, +false+ otherwise. An error status is
available in +$?+. The arguments are processed in the same way as
for +Kernel::exec+.