Hello, I have the below two commands I run from the windows command
prompt. I would like to now call these two commands from my local ruby
script. How would I go about doing this?
% ipconfig /all > output.txt
% convert -size 100x100 image.tiff image.png (I’ve this tool in my path)
Thank-you in advance, michelle
/ASIDE:/
This specific question originated in a previous post. Since the answer
in isolation may be useful to many people I decided to create a new
separate post here. see Converting .tiff -to-> .png? - Ruby - Ruby-Forum
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Am 16.08.2011 08:44, schrieb Michelle P.:
/ASIDE:/ This specific question originated in a previous post. Since
the answer in isolation may be useful to many people I decided to
create a new separate post here. see
Converting .tiff -to-> .png? - Ruby - Ruby-Forum
Use one of:
- system(“yourcommand”)
-
yourcommand (these are backticks)
- spawn(“yourcommand”)
The differences:
- system waits until “yourcommand” has finished and outputs everything
to $stdout. Then it returns true or false depending on the exitstatus.
- The backticks wait as well, but return the output made by the program.
- spawn doesn’t wait, but rather returns the PID of the subprocess. Note
that this requires Ruby 1.9 on Windows to work.
There’s also exec(“yourcommand”), but that’s probably not what you want.
It replaces your Ruby process with “yourcommand”. Oh, and IO.popen if
you need a pipeline to your process. 
Vale,
Marvin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJOShO1AAoJELh1XLHFkqharzAH/AxIHbC4r5JMxkHBS6ceU16X
Udv8JHhqWMI3GPmISev4sbEp6JqulCWlOw1mziLb+GjokqMk4vLlBt9YS3Lwn/he
uXWO6ym0XGYC7/wyNpiwLVPUsusqBPwEjZuGjtY/rjMhDihkWxpfBzc5pIdl4xId
vLcYii3Hbxy987qtjq9fs5NF6Ynx9WkyIeibrn+vPkDW5liu1z32iiCzHOZtmL51
flM6mWDdYx4HsS/oledqJ4syX2zhyxnwLg3auvLNR43xBfuqdITYOjgt04BLC6gH
81VGFQeQJSouJhk+hcPR/Wr2cZLgi+Mlh+PI1ycv67STwzLEgMaKhmwrlujLpPI=
=c7GV
-----END PGP SIGNATURE-----