Subject: [ruby-talk:13379] Re: Passing an array to `exec'?
From: Dave Thomas <Dave PragmaticProgrammer.com>
Date: Sat, 31 Mar 2001 14:52:44 +0900
References: 1337413377
In-reply-to: Lloyd Zusman's message of "Sat, 31 Mar 2001 14:40:04 +0900"
Lloyd Zusman <ljz / asfast.com> writes:
> cmd = [ '/bin/ls' ].concat( ARGV )
> eval 'exec("' + cmd.join('", "') + '")'
Use the multi-argument form of exec:
exec( "/bin/ls", *ARGV)
Regards
Dave