Running shell scripts

How can I run this command from my ruby script?

/usr/bin/java -jar #{jsmin_path}/custom_rhino.jar -c
#{tmp_path}_uncompressed.js

veggie5 wrote:

How can I run this command from my ruby script?

/usr/bin/java -jar #{jsmin_path}/custom_rhino.jar -c
#{tmp_path}_uncompressed.js

ri Kernel#system

Tim H. [email protected] wrote:

veggie5 wrote:

How can I run this command from my ruby script?

/usr/bin/java -jar #{jsmin_path}/custom_rhino.jar -c
#{tmp_path}_uncompressed.js

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+.

    system("echo *")
    system("echo", "*")

 _produces:_

    config.h main.rb
    *

(END)

Une Bévue [email protected] wrote:

ri Kernel#system

better (on mac os x) :

ri Kernel#system

On Sep 25, 2007, at 9:00 PM, Une Bévue wrote:

Une Bévue [email protected] wrote:

ri Kernel#system

better (on mac os x) :

ri Kernel#system

The first version works fine on my OS X box:

Welcome to Darwin!
Firefly:~$ ri -T 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+.

     system("echo *")
     system("echo", "*")

  _produces:_

     config.h main.rb
     *

James Edward G. II

On Sep 25, 6:59 pm, [email protected] (Une
Bévue) wrote:

Une Bévue [email protected] wrote:

ri Kernel#system

better (on mac os x) :

ri Kernel#system


Une Bévue

thanks

Une Bévue wrote:

ri Kernel.system or enclosing the arguments to ri in ‘’ should work on
most
systems too :slight_smile:

TerryP.

James Edward G. II [email protected] wrote:

The first version works fine on my OS X box:

here is my output :

~%> ri Kernel#system
zsh: no matches found: Kernel#system

i’m using zsh as shell script, may u aren’t using it, this could be the
reason, because it’s zsh interpreting the command line and which found
something wrong, the reason for my escaping #…

otherwise i’m using :

~%> which ruby
/opt/local/bin/ruby
~%> /opt/local/bin/ruby --version
ruby 1.8.6 (2007-03-13 patchlevel 0) [powerpc-darwin8.9.0]
~%>

over MacOS X 10.4.10 running in a PPC iMac.

and also :

~%> zsh --version
zsh 4.3.2 (powerpc-apple-darwin8.8.0)

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs