Forum: Ruby Where has my output gone???

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
andrew (Guest)
on 2005-12-09 15:13
(Received via mailing list)
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
slitt (Guest)
on 2005-12-09 15:54
(Received via mailing list)
On Friday 09 December 2005 08:09 am, Andrew Walrond wrote:
> TIA
>
> Andrew Walrond

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

SteveT

Steve L.
http://www.troubleshooters.com
removed_email_address@domain.invalid
andrew (Guest)
on 2005-12-09 16:15
(Received via mailing list)
On Friday 09 December 2005 13:52, Steve L. wrote:
>
> Is there any chance that your program is outputting to stderr instead of
> stdout?
>

Nope; example:

root@orac main $ sbin/heretix --bs /home/andrew/prebuild/x86_64/ --cf
kdelibs version=none
Build settings:  cpu=x86_64  build-jobs=4  make-jobs=4
Processing......
  -u kdelibs
  -u kdebase
root@orac main $ sbin/heretix --bs /home/andrew/prebuild/x86_64/ --cf
kdelibs version=none > out
root@orac main $ cat out
root@orac main $
bob.news (Guest)
on 2005-12-09 17:04
(Received via mailing list)
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 (Guest)
on 2005-12-09 17:49
(Received via mailing list)
On Friday 09 December 2005 15:02, Robert K. 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
This topic is locked and can not be replied to.