From: Robert Klemme Date: 2010-01-26T18:46:54+09:00 Subject: Re: Pass arguments to 'require' 2010/1/26 Toby Rodwell : > [You will be able to tell from what follows that I'm not a programmer - > please bear with me!] > > I wrote two scripts and, for the frequent occasions I would want to run > one then the other, a third script which was just:- > > #!/usr/bin/ruby > > require '/opt/ruby/script1' > require '/opt/ruby/script2' > > I would now like to pass arguments to the two scripts (for simplicity > the same arguments in each case), andI would like to be able to do this > via the third script eg > > require '/opt/ruby/script1 #{ARGV}' > require '/opt/ruby/script2 #{ARGV}' > > but Ruby doesn't accept this.  For now I'm using a bash script, like so: > > #!/bin/bash > > /opt/ruby/script1 $@ > /opt/ruby/script2 $@ > > but, partly for "niceness" reasons, I would like to use Ruby instead. > Any suggestions on how to do this simply?  Thanks in advance. Use system instead of require: system '/opt/ruby/script1', *ARGV system '/opt/ruby/script2', *ARGV Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/