From: Glen Holcomb Date: 2008-11-25T06:18:48+09:00 Subject: Re: Can you run a command line script with arguments, without typing 'ruby' first? ------=_Part_182925_17105590.1227561797919 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On Mon, Nov 24, 2008 at 2:21 PM, Glen Holcomb wrote: > > > On Mon, Nov 24, 2008 at 2:12 PM, Jayson Williams < > williams.jayson@gmail.com> wrote: > >> I am using win os, so the shabang thing isn't an option for me. I put >> the script in my ruby bin path, and I can access the script from >> anywhere now, but I still have the same problem with the script not >> running properly unless i type ruby first. It is as if ruby does not >> attempt to read in arguments unless you explicitly pass the script >> through ruby. If I call the script with the arguments without putting >> 'ruby' first, the args don't seem to get read. >> >> >> On Mon, Nov 24, 2008 at 2:05 PM, Diogo Lisboa >> wrote: >> > chmod a+x my_script (restrict permissions if you want) >> > ./my_script args >> > >> > or put my_script in your PATH, and just type `my_script args' >> > >> > On Mon, Nov 24, 2008 at 4:47 PM, Jayson Williams >> > wrote: >> >> Hi All, >> >> >> >> I would like to do this -> my_script arg1, arg2 >> >> This doesn't seem to work when the script has arguments. >> >> >> >> But if I type -> ruby my_script arg1,arg2 >> >> It works fine. >> >> >> >> Is there a way I can run the my_script without typing ruby each time? >> >> Thanks >> >> >> >> >> > >> > >> > >> > -- >> > Diogo >> > >> > >> >> > Yep, in Windows you have to invoke ruby first on the command line. The > shebang in the Unix world is kind of a short hand for doing this. > > -- > "Hey brother Christian with your high and mighty errand, Your actions speak > so loud, I can't hear a word you're saying." > > -Greg Graffin (Bad Religion) > If you absolutely must get rid of the need to type ruby first you could use rubyscript2exe to build a windows exe file out of your script. -- "Hey brother Christian with your high and mighty errand, Your actions speak so loud, I can't hear a word you're saying." -Greg Graffin (Bad Religion) ------=_Part_182925_17105590.1227561797919--