From: Lloyd Zusman Date: 2007-01-28T04:26:08+09:00 Subject: Re: script with -e command line option??? Suresh Unadrad writes: > Robert Klemme wrote: >>This looks like "ruby" was a shell script that does not properly quote >>arguments > > Rob Biedenharn wrote: >> I'd start to suspect that you have "ruby" >> defined as an alias or something to make the args be evaluated twice. > > Turns out that this was indeed the problem. When I started using the > ruby fltk extensions, I found that I had to replace /usr/bin/ruby with > the following script: > > #!/bin/bash > > export LD_ASSUME_KERNEL=2.3.98 > exec /usr/bin/ruby1.8 $* > > > so that's why the arguments were being evaluated twice. > > thanks everyone for your help! I would recommend that you do this in your script: #!/bin/bash export LD_ASSUME_KERNEL=2.3.98 exec /usr/bin/ruby1.8 "$@" The "$@" construct will help to maintain the quoting of the arguments which are passed in. For example: script1 ------- #!/bin/bash for arg in $* do echo arg=$arg done script2 ------- #!/bin/bash for arg in "$@" do echo arg=$arg done % chmod +x script1 script2 % ./script1 "this is the first arg" "this is the second arg" arg=this arg=is arg=the arg=first arg=arg arg=this arg=is arg=the arg=second arg=arg % ./script2 "this is the first arg" "this is the second arg" arg=this is the first arg arg=this is the second arg -- Lloyd Zusman ljz@asfast.com God bless you.