[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

IO.popen how to separate $stdout and $stderr

unbewusst.sein

2/26/2008 3:24:00 PM

when doing a :

r = IO.popen( cmd )

are the outputs of the cmd still separated in $stdout and stderr ?

how to retrieve them.

my basic usage is for an xslt transform (xslt 2.0) using saxon8.jar :

cmd = java -cp ../saxon-resources8-9/saxon8.jar net.sf.saxon.Transform
\"#{the_xml_file}\" \"#{the_xsl_file}\""

--
Une Bévue
24 Answers

Justin Collins

2/27/2008 12:53:00 AM

0

Une Bévue wrote:
> when doing a :
>
> r = IO.popen( cmd )
>
> are the outputs of the cmd still separated in $stdout and stderr ?
>
> how to retrieve them.
>
> my basic usage is for an xslt transform (xslt 2.0) using saxon8.jar :
>
> cmd = java -cp ../saxon-resources8-9/saxon8.jar net.sf.saxon.Transform
> \"#{the_xml_file}\" \"#{the_xsl_file}\""
>

From the documentation[1]:
" Runs the specified command string as a subprocess; the subprocess's
standard input and output will be connected to the returned IO object."

This means you can reading from the returned IO object will get you the
standard output and writing to it will send the data to the standard
input of the application. This works just like any other IO of File object.

If you need to get standard error as well, you need to use Open3#popen3[2]

Hope that helps.
-Justin

[1]http://ruby-doc.org/core/classes/IO.ht...
[2]http://ruby-doc.org/core/classes/...

JamesHutchinson

1/5/2013 6:19:00 PM

0



"BeamMeUpScotty" wrote in message
news:50E86AB2.2010401@blackhole.nebulax.com...




>> General Motors Tripled Sales Of Chevy Volt In 2012, Selling One Million
>> Vehicles Over 30 MPG


So General motors sold 30 Chevy Volts a month rather than just 10?


They are still the worst selling car since the Edsel. Who wants an
electric car when our Nation is becoming 3rd world like Iraq and
Venezuela and other places that have rotating black-outs because they
can't produce enough electricity, and their transmission line
infrastructure is aging and falling apart.

>^^^^

Ya know, I would LOVE to have an Edsel... with Sean Penn in the trunk.
http://www.youtube.com/watch?v=4...

Nickname unavailable

1/6/2013 8:34:00 AM

0

On Jan 5, 1:53 pm, Marvin the Martian <mar...@ontomars.org> wrote:
> On Sat, 05 Jan 2013 13:02:26 -0500, BeamMeUpScotty wrote:
> >>> General Motors Tripled Sales Of Chevy Volt In 2012, Selling One
> >>> Million Vehicles Over 30 MPG
>
> > So General motors sold 30 Chevy Volts a month rather than just 10?
>
> > They are still the worst selling car since the Edsel. Who wants an
> > electric car when our Nation is becoming 3rd world like Iraq and
> > Venezuela and other places that have rotating black-outs because they
> > can't produce enough electricity, and their transmission line
> > infrastructure is aging and falling apart.
>
> > The "Volt" was another flop.
>
> > Maybe they should sell the Chevy volt with a FREE generator with every
> > purchase to get more people interested.  Or a FREE gun for protection
> > for when your electric car dies on the road and no one but a NASA
> > technician can fix it?
>
> > Or they could just buy an old used gas car and be better-off.
>
> Well, that's just it... Volts are subsidized by the American taxpayer.
>
> There's the $7500 per car tax credit for buying one of these POS cars,
> yes, but the government subsidies for electric cars is another $250,000.
> (Google: Chevy Volt Subsidy)

damn the stupidity. lots of japanese car companies take subsidies
from american governments stupid. R&D is expensive, and subsidies are
given out by governments world wide. but you are so stupid, you have
no real clue as to how businesses work. and the volt is selling well
now, and the stupid look even dumber than they already are. its
selling better than the japanese stuff:)))))))))))))))))))

max headroom

1/6/2013 7:04:00 PM

0

Nickname unavailable <video61cq.net@gtempaccount.com> wrote in
news:58761eb2-3420-4bb7-b080-7345335d2ed1@4g2000yqv.googlegroups.com:

> On Jan 5, 1:53 pm, Marvin the Martian <mar...@ontomars.org> wrote:

>> On Sat, 05 Jan 2013 13:02:26 -0500, BeamMeUpScotty wrote:

>>>>> General Motors Tripled Sales Of Chevy Volt In 2012, Selling One
>>>>> Million Vehicles Over 30 MPG

>>> So General motors sold 30 Chevy Volts a month rather than just 10?

>>> They are still the worst selling car since the Edsel. Who wants an
>>> electric car when our Nation is becoming 3rd world like Iraq and
>>> Venezuela and other places that have rotating black-outs because they
>>> can't produce enough electricity, and their transmission line
>>> infrastructure is aging and falling apart.

>>> The "Volt" was another flop.

>>> Maybe they should sell the Chevy volt with a FREE generator with every
>>> purchase to get more people interested. Or a FREE gun for protection
>>> for when your electric car dies on the road and no one but a NASA
>>> technician can fix it?

>>> Or they could just buy an old used gas car and be better-off.

>> Well, that's just it... Volts are subsidized by the American taxpayer.

>> There's the $7500 per car tax credit for buying one of these POS cars,
>> yes, but the government subsidies for electric cars is another $250,000.
>> (Google: Chevy Volt Subsidy)

> damn the stupidity. lots of japanese car companies take subsidies
> from american governments stupid. R&D is expensive, and subsidies are
> given out by governments world wide. but you are so stupid, you have
> no real clue as to how businesses work....

So you approve of tax dollars subsidizing private businesses?

Auto makers?

Pharmaceutical houses?

Oil companies?

Banks?

> ... and the volt is selling well now,...

Yeah, less than 2,000 a month. About the same as Honda Civics sold in Los Angeles

But that's only if you include sales to government and leases (as low as $199.month) in the sales
figures.

> ... and the stupid look even dumber than they already are. its
> selling better than the japanese stuff:)))))))))))))))))))

"Sales of high-profile hybrid and electric vehicles were a mixed bag in 2012. GM's Chevrolet Volt
tripled sales to 23,461, but still fell well short of the company's original goal of 40,000
vehicles. Nissan's Leaf was virtually flat, at 9,819.

"Toyota maintained its lead in the green-car category, with total Prius sales of 236,659, up 73
percent with the addition of three new Prius derivatives in the past year."

http://www.reuters.com/article/2013/01/03/us-usa-autosales-idUSBRE9020...

So one Japanese "stuff" is selling ten times the Volt's numbers.

" ... and the stupid look even dumber than they already are..." indeed. Savor the sublime taste of
foot.


Nickname unavailable

1/6/2013 7:51:00 PM

0

On Jan 6, 1:03 pm, "max headroom" <maxheadr...@localnet.com> wrote:
> Nickname unavailable <video61cq....@gtempaccount.com> wrote innews:58761eb2-3420-4bb7-b080-7345335d2ed1@4g2000yqv.googlegroups.com:
>
>
>
>
>
>
>
>
>
> > On Jan 5, 1:53 pm, Marvin the Martian <mar...@ontomars.org> wrote:
> >> On Sat, 05 Jan 2013 13:02:26 -0500, BeamMeUpScotty wrote:
> >>>>> General Motors Tripled Sales Of Chevy Volt In 2012, Selling One
> >>>>> Million Vehicles Over 30 MPG
> >>> So General motors sold 30 Chevy Volts a month rather than just 10?
> >>> They are still the worst selling car since the Edsel. Who wants an
> >>> electric car when our Nation is becoming 3rd world like Iraq and
> >>> Venezuela and other places that have rotating black-outs because they
> >>> can't produce enough electricity, and their transmission line
> >>> infrastructure is aging and falling apart.
> >>> The "Volt" was another flop.
> >>> Maybe they should sell the Chevy volt with a FREE generator with every
> >>> purchase to get more people interested. Or a FREE gun for protection
> >>> for when your electric car dies on the road and no one but a NASA
> >>> technician can fix it?
> >>> Or they could just buy an old used gas car and be better-off.
> >> Well, that's just it... Volts are subsidized by the American taxpayer.
> >> There's the $7500 per car tax credit for buying one of these POS cars,
> >> yes, but the government subsidies for electric cars is another $250,000.
> >> (Google: Chevy Volt Subsidy)
> >  damn the stupidity. lots of japanese car companies take subsidies
> > from american governments stupid. R&D is expensive, and subsidies are
> > given out by governments world wide. but you are so stupid, you have
> > no real clue as to how businesses work....
>
> So you approve of tax dollars subsidizing private businesses?
>
> Auto makers?
>
> Pharmaceutical houses?
>
> Oil companies?
>
> Banks?
>
> > ... and the volt is selling well now,...
>
> Yeah, less than 2,000 a month. About the same as Honda Civics sold in Los Angeles
>
> But that's only if you include sales to government and leases (as low as $199.month) in the sales
> figures.
>
> > ... and the stupid look even dumber than they already are. its
> > selling better than the japanese stuff:)))))))))))))))))))
>
> "Sales of high-profile hybrid and electric vehicles were a mixed bag in 2012. GM's Chevrolet Volt
> tripled sales to 23,461, but still fell well short of the company's original goal of 40,000
> vehicles. Nissan's Leaf was virtually flat, at 9,819.
>
> "Toyota maintained its lead in the green-car category, with total Prius sales of 236,659, up 73
> percent with the addition of three new Prius derivatives in the past year.."
>
> http://www.reuters.com/article/2013/01/03/us-usa-autosales-......
>
> So one Japanese "stuff" is selling ten times the Volt's numbers.
>
> " ... and the stupid look even dumber than they already are..." indeed. Savor the sublime taste of
> foot.

yet, toyota takes subsidized money, can't read stupid!!!!!!! and yes,
every government subsidizes. even the founders were for it.


the founders of the american government loaned paul revere start up
money for industrial production:america was founded on a strong
government with broad based powers to tax/legislate/regulate and to
promote and provide for the general welfare


http://americanmanufacturing.org/blog/paul-revere-us-manufacturer-saved-day-237-years...

Paul Revere, U.S. manufacturer, saved the day--237 years ago today
Posted by scapozzola on 04/18/2012





Today is April 18, 2012...
On this day in 1775, Paul Revere rode to Lexington, Massachusetts, to
warn Samuel Adams and John Hancock that British troops were marching
to arrest them. After being rowed across the Charles River to
Charlestown by two associates, Revere borrowed a horse from his friend
Deacon John Larkin and set out on horseback.??On the way to Lexington,
Revere "alarmed" the country-side, stopping at each house to announce
that "The British are coming."
Revere's ride was made famous in Henry Wadsworth Longfellow's poem,
"Paul Revere's Ride."  But Revere is also recognized as one of the
nation's first great manufacturers.  A metalworker and silversmith,
Revere's work became highly prized, and he produced more than 5,000
products in his shop, including buckles, buttons, rings and beads.
Revere understood the need for a nation to be industrially self-
sufficient.  To rectify desperate shortages of gunpowder during the
Revolutionary War, Revere studied the one working gunpowder mill in
the colonies, located in Philadelphia.  He subsequently built a new
powder mill in Canton, Massachusetts that produced tons of gunpowder
for the revolutionary army.
After the war, and finding the silver trade to be more difficult,
Revere became a pioneer in the production of rolled copper, opening
North America's first copper mill south of Boston in Canton, in 1800.
Revere had initially launched his copper works at the behest of the
U.S. government.  Concerned about a possible second war with the
British, the U.S. Navy loaned Revere $10,000 to launch a foundry that
couuld sheathe the hulls of naval vessels with protective copper
layering.  The early U.S. government astutely feared a potential
second conflict with the British and, in recognizing the need for both
greater domestic manufacturing and national secturity, funded the
start-up of Revere's company.
After the initial naval work, copper from the Revere Copper Company
was used to cover the original wooden dome of the Massachusetts State
House in 1802. The firm also cast the first church bell made in Boston
and ultimately produced more than 900 church bells. This church bell
worked helped Revere to pay off his debts to the U.S. government and
expand his business.??Revere's copper and brass works eventually grew
into a large national corporation, Revere Copper and Brass, Inc. That
company continues today as the Revere Copper Products in Rome, New
York.
Revere Copper's Chairman, Brian O'Shaughnessy, says that Revere's
legacy is still exceptionally relevant today, and that his spirit of
craftsmanship and innovation lives on, fused with the copper
industry's most advanced technologies and highest standards of
excellence.  Revere Copper continues to advocate for domestic U.S.
manufacturers and is outspoken in its concerns about America remaining
competitive in the face of "the mercantilism of China and other
countries."

Nickname unavailable

1/7/2013 1:37:00 AM

0

On Jan 6, 7:23 pm, Marvin the Martian <mar...@ontomars.org> wrote:
> On Sun, 06 Jan 2013 00:33:37 -0800, Nickname unavailable wrote:
> > On Jan 5, 1:53 pm, Marvin the Martian <mar...@ontomars.org> wrote:
> >> On Sat, 05 Jan 2013 13:02:26 -0500, BeamMeUpScotty wrote:
> >> >>> General Motors Tripled Sales Of Chevy Volt In 2012, Selling One
> >> >>> Million Vehicles Over 30 MPG
>
> >> > So General motors sold 30 Chevy Volts a month rather than just 10?
>
> >> > They are still the worst selling car since the Edsel. Who wants an
> >> > electric car when our Nation is becoming 3rd world like Iraq and
> >> > Venezuela and other places that have rotating black-outs because they
> >> > can't produce enough electricity, and their transmission line
> >> > infrastructure is aging and falling apart.
>
> >> > The "Volt" was another flop.
>
> >> > Maybe they should sell the Chevy volt with a FREE generator with
> >> > every purchase to get more people interested.  Or a FREE gun for
> >> > protection for when your electric car dies on the road and no one but
> >> > a NASA technician can fix it?
>
> >> > Or they could just buy an old used gas car and be better-off.
>
> >> Well, that's just it... Volts are subsidized by the American taxpayer.
>
> >> There's the $7500 per car tax credit for buying one of these POS cars,
> >> yes, but the government subsidies for electric cars is another
> >> $250,000.
> >> (Google: Chevy Volt Subsidy)
>
> >  damn the stupidity. lots of japanese car companies take subsidies
> > from american governments stupid.
>
> Yes, the American government gives big subsidies for all kinds of
> expensive cars that only the rich can afford.
>
> What kind of dumb jackass are you that you're GOOD with that?!
> <http://www.slate.com/articles/business/moneybo...
> highways_paved_with_gold.html>
>
> How is that even RELEVANT to the fact that taxpayers are subsidizing a POS
> car for RICH people?!
>
> You're gibbering!

gee, how come state government subsidize expensive toyotas dummy.
computers used to be so expensive, that only the wealthy could afford
them. government bought millions of them in the 1970's, this brought
the costs down to the point where just about anyone could afford one,
the government created the computer industry, the rest is history.

max headroom

1/7/2013 4:10:00 AM

0

Nickname unavailable <video61cq.net@gtempaccount.com> wrote in
news:db264136-ecc2-4534-9e20-daf24eb37918@4g2000yqv.googlegroups.com:

> computers used to be so expensive, that only the wealthy could afford
> them. government bought millions of them in the 1970's, this brought
> the costs down to the point where just about anyone could afford one,
> the government created the computer industry, the rest is history.

Bullshit. Pure bullshit.

The microcomputer (desktop) industry grew from the ground up. Big government and big businesses
(with big IT departments) were among the last to jump aboard.



Nickname unavailable

1/7/2013 4:30:00 AM

0

On Jan 6, 10:09 pm, "max headroom" <maxheadr...@localnet.com> wrote:
> Nickname unavailable <video61cq....@gtempaccount.com> wrote innews:db264136-ecc2-4534-9e20-daf24eb37918@4g2000yqv.googlegroups.com:
>
> > computers used to be so expensive, that only the wealthy could afford
> > them. government bought millions of them in the 1970's, this brought
> > the costs down to the point where just about anyone could afford one,
> > the government created the computer industry, the rest is history.
>
> Bullshit. Pure bullshit.
>
> The microcomputer (desktop) industry grew from the ground up.



and the computers were expensive.


Big government and big businesses
> (with big IT departments) were among the last to jump aboard.

yet, big government purchases brought the price down. just as big
government purchases of automobiles, keep the prices down. damn, not
one "CONSERVATIVE" even has a basic understanding of how business
works.

max headroom

1/7/2013 5:54:00 AM

0

Nickname unavailable <video61cq.net@gtempaccount.com> wrote in
news:dfd24182-ece5-49c9-8972-49c13d9f6a43@f8g2000yqa.googlegroups.com:

> On Jan 6, 10:09 pm, "max headroom" <maxheadr...@localnet.com> wrote:

>> Nickname unavailable <video61cq....@gtempaccount.com> wrote
>> innews:db264136-ecc2-4534-9e20-daf24eb37918@4g2000yqv.googlegroups.com:

>>> computers used to be so expensive, that only the wealthy could afford
>>> them. government bought millions of them in the 1970's, this brought
>>> the costs down to the point where just about anyone could afford one,
>>> the government created the computer industry, the rest is history.

>> Bullshit. Pure bullshit.

>> The microcomputer (desktop) industry grew from the ground up.

> and the computers were expensive.

> Big government and big businesses
>> (with big IT departments) were among the last to jump aboard.

> yet, big government purchases brought the price down....

How many Apple][s did the government buy? How many Trash 80s, Vic 20s, Ataris, Sinclairs, and
TI-99/4s?

It was VisiCalc on the Apple][ that moved microcomputers into small businesses and got IBM's
attention. It was IBM's (foolish) decision to allow MicroSoft to sell PC-DOS under its own label
that let Compac (and later Dell and Gateway) flourish and turn the IBM PC into a generic DOS-box
that brought prices down. NONE of this happened with government influence!

> ... just as big government purchases of automobiles, keep the prices down. damn, not
> one "CONSERVATIVE" even has a basic understanding of how business works.

Once again we see a pinkie rewriting history to serve its political agenda.



Nickname unavailable

1/8/2013 1:56:00 AM

0

On Jan 6, 11:54 pm, "max headroom" <maxheadr...@localnet.com> wrote:
> Nickname unavailable <video61cq....@gtempaccount.com> wrote innews:dfd24182-ece5-49c9-8972-49c13d9f6a43@f8g2000yqa.googlegroups.com:
>
> > On Jan 6, 10:09 pm, "max headroom" <maxheadr...@localnet.com> wrote:
> >> Nickname unavailable <video61cq....@gtempaccount.com> wrote
> >> innews:db264136-ecc2-4534-9e20-daf24eb37918@4g2000yqv.googlegroups.com:
> >>> computers used to be so expensive, that only the wealthy could afford
> >>> them. government bought millions of them in the 1970's, this brought
> >>> the costs down to the point where just about anyone could afford one,
> >>> the government created the computer industry, the rest is history.
> >> Bullshit. Pure bullshit.
> >> The microcomputer (desktop) industry grew from the ground up.
> >  and the computers were expensive.
> > Big government and big businesses
> >> (with big IT departments) were among the last to jump aboard.
> >  yet, big government purchases brought the price down....
>
> How many Apple][s did the government buy? How many Trash 80s, Vic 20s, Ataris, Sinclairs, and
> TI-99/4s?
>



you must be kidding.


> It was VisiCalc on the Apple][ that moved microcomputers into small businesses and got IBM's
> attention. It was IBM's (foolish) decision to allow MicroSoft to sell PC-DOS under its own label
> that let Compac (and later Dell and Gateway) flourish and turn the IBM PC into a generic DOS-box
> that brought prices down. NONE of this happened with government influence!
>


yet, you still do not get it. it was the massive buying power of
government, that got the price down.


> > ... just as big government purchases of automobiles, keep the prices down. damn, not
> > one "CONSERVATIVE" even has a basic understanding of how business works.
>
> Once again we see a pinkie rewriting history to serve its political agenda.

nope, just was there, and saw it.