GithubHelp home page GithubHelp logo

formatted output cannot be piped about bmon HOT 7 CLOSED

tgraf avatar tgraf commented on August 26, 2024
formatted output cannot be piped

from bmon.

Comments (7)

tgraf avatar tgraf commented on August 26, 2024

I believe this has already been fixed. Curses used to be initialized for formatted output but this is no longer the case. What you describe works for me.

from bmon.

yberreby avatar yberreby commented on August 26, 2024

I have version 3.6 on OS X, installed with homebrew. I'll try building from source.

from bmon.

yberreby avatar yberreby commented on August 26, 2024

Still doesn't work with a fresh clone. Any idea why?

yohai@imac-5k ~/code/software/bmon$ bmon -o format
lo0 44484079 44484079 629458 629458
en0 248662754 38887010 296994 251607
en1 0 0 0 0
en2 0 0 0 0
en3 0 0 0 0
bridge0 0 342 0 1
^C
yohai@imac-5k ~/code/software/bmon$ bmon -o format > foo.txt
^C
yohai@imac-5k ~/code/software/bmon$ ls -lrt
total 984
drwxr-xr-x   3 yohai  staff     102 30 jui 12:05 m4
-rw-r--r--   1 yohai  staff    5402 30 jui 12:05 configure.ac
-rwxr-xr-x   1 yohai  staff      52 30 jui 12:05 autogen.sh
-rw-r--r--   1 yohai  staff    1587 30 jui 12:05 README.md
-rw-r--r--   1 yohai  staff     619 30 jui 12:05 NEWS
-rw-r--r--   1 yohai  staff     143 30 jui 12:05 Makefile.am
-rw-r--r--   1 yohai  staff    1023 30 jui 12:05 LICENSE.MIT
-rw-r--r--   1 yohai  staff    1192 30 jui 12:05 LICENSE.BSD
-rw-r--r--   1 yohai  staff       0 30 jui 12:05 ChangeLog
-rwxr-xr-x   1 yohai  staff  262681 30 jui 12:05 configure
-rw-r--r--   1 yohai  staff   49976 30 jui 12:05 aclocal.m4
drwxr-xr-x   8 yohai  staff     272 30 jui 12:05 build-aux
-rw-r--r--   1 yohai  staff   25532 30 jui 12:05 Makefile.in
drwxr-xr-x   6 yohai  staff     204 30 jui 12:05 man
drwxr-xr-x   6 yohai  staff     204 30 jui 12:05 include
drwxr-xr-x   6 yohai  staff     204 30 jui 12:05 examples
-rwxr-xr-x   1 yohai  staff   35180 30 jui 12:05 config.status
-rw-r--r--   1 yohai  staff   55532 30 jui 12:05 config.log
-rw-r--r--   1 yohai  staff   25779 30 jui 12:05 Makefile
drwxr-xr-x  52 yohai  staff    1768 30 jui 12:05 src
-rw-r--r--   1 yohai  staff       0 30 jui 12:07 foo.txt
yohai@imac-5k ~/code/software/bmon$

I'm running OS X 10.10.2 (Yosemite).

from bmon.

tgraf avatar tgraf commented on August 26, 2024

This seems to be OS X specific then. Works fine on Linux:

[tgraf@lsx bmon]$ src/bmon -o format > l
^C
[tgraf@lsx bmon]$ wc -l l
262 l

Can you try the following?
bmon -o format:stderr 2> foo.txt

from bmon.

yberreby avatar yberreby commented on August 26, 2024

bmon -o format:stderr 2> foo.txt produces a output file with the data, it works.

from bmon.

tgraf avatar tgraf commented on August 26, 2024

This may be related to OS X buffering stdout which delays writing to stdout immediately. You may have to use unbuffer or stdbuf if you want to use stdout. Just a guess though.

from bmon.

yberreby avatar yberreby commented on August 26, 2024

The problem was indeed caused by buffering - unbuffer solved it. Thanks!

from bmon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.