Running shell scripts

E

eggie5

How can I run this command from my ruby script?

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

Tim Hunter

veggie5 said:
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
 
U

Une Bévue

Tim Hunter said:
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)
 
J

James Edward Gray II

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, ...]) =3D> 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 Gray II=
 
U

Une Bévue

James Edward Gray II said:
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top