dos %x{..} and my nUUbness

J

John Hager

------=_Part_1586_21195276.1121215496888
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Forgive my newbness :)=20

I am attempting to fire up a dos batch file, like for example startup a=20
jboss server instance.=20

In my *.rb script, I have this straight snippet:=20

puts %x{ c:/zone/jboss-4.0.1sp1/bin/run.bat -c node1 }

It works when I hard-code the path and args as in the sample above.=20

The path and path-args are hard-coded, because I can't figure out how to=20
pass in a variable and still get the server to start.=20

I have tried these:=20

puts %x{ printf "%s/bin/run.bat -c %s", serverPath, nodeName }
puts %x{ serverPath + "/bin/run.bat -c " + nodeName }
print %x{ serverPath + "/bin/run.bat -c " + nodeName }

and all kinds of others, so how to make the magic? How would you launch a=
=20
narly .bat file with a bunch of args and slashes passed along?=20

Also, is there a way to fire the DOS batch file and not have the script=20
pause for the process to finish ... so a non-blocking dos call?=20

Thanks.=20
-John A

------=_Part_1586_21195276.1121215496888--
 
G

Gavin Kistner

puts %x{ c:/zone/jboss-4.0.1sp1/bin/run.bat -c node1 }

It works when I hard-code the path and args as in the sample above.

The path and path-args are hard-coded, because I can't figure out
how to
pass in a variable and still get the server to start.

String interpolation works in many magical places.


path = "c:/zone/jboss-4.0.1sp1/bin/"
puts %x{ #{path}run.bat -c node1 }
 

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,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top