[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Where has my output gone???

Andrew Walrond

12/9/2005 1:10:00 PM

I run my ruby script, and it produces lots of output

I run the same script, but redirect the output to a file (bash shell using >),
no output!

Whats going on? I just know there is a simple answer, and I have a nagging
feeling that its been discussed here before...

Help...quick...please... before I pull _all_ my hair out!

TIA

Andrew Walrond


3 Answers

Steve Litt

12/9/2005 1:53:00 PM

0

On Friday 09 December 2005 08:09 am, Andrew Walrond wrote:
> I run my ruby script, and it produces lots of output
>
> I run the same script, but redirect the output to a file (bash shell using
> >), no output!
>
> Whats going on? I just know there is a simple answer, and I have a nagging
> feeling that its been discussed here before...
>
> Help...quick...please... before I pull _all_ my hair out!
>
> TIA
>
> Andrew Walrond

Is there any chance that your program is outputting to stderr instead of
stdout?

SteveT

Steve Litt
http://www.troublesh...
slitt@troubleshooters.com


Robert Klemme

12/9/2005 3:02:00 PM

0

Andrew Walrond wrote:
> I run my ruby script, and it produces lots of output
>
> I run the same script, but redirect the output to a file (bash shell
> using >), no output!
>
> Whats going on? I just know there is a simple answer, and I have a
> nagging feeling that its been discussed here before...
>
> Help...quick...please... before I pull _all_ my hair out!

Did you wait until your script actually terminated? If not, you probably
became a victim of buffering. Try $stdout.sync=true or $>.sync=true at
the start of the script instead of pulling hair out.

Kind regards

robert

Andrew Walrond

12/9/2005 3:49:00 PM

0

On Friday 09 December 2005 15:02, Robert Klemme wrote:

> became a victim of buffering. Try $stdout.sync=true or $>.sync=true at
> the start of the script instead of pulling hair out.
>

Damn. I should have known that.

Thanks Robert!

Andrew Walrond